Created
October 22, 2015 14:08
-
-
Save xy4n/ddfc20f78653a60c636d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
int main(int argc, char* argv[]) { | |
if(argc < 2) | |
return 1; | |
int i, j; | |
char* str = argv[1]; | |
for(i = 0; i < (2*strlen(str)); i++) { | |
if (i<strlen(str)) { | |
int n; | |
for(n = 0; n<(strlen(str)-i-1); n++) | |
putchar(' '); | |
} | |
for(j = 0; j < strlen(str); j++) { | |
if((i-j) < strlen(str)) { | |
printf("%c", str[j]); | |
} | |
} | |
putchar('\n'); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment