Skip to content

Instantly share code, notes, and snippets.

@xy4n
Created October 22, 2015 14:08
Show Gist options
  • Save xy4n/ddfc20f78653a60c636d to your computer and use it in GitHub Desktop.
Save xy4n/ddfc20f78653a60c636d to your computer and use it in GitHub Desktop.
#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