#include <stdio.h> #include <string.h> int main(void) { char *str = "123456789"; int i = 0, slen = strlen(str); for (; slen > 0; ++i, slen -= 2) printf("%*.*s\n", slen + i, slen, str + i); return 0; }
#include <stdio.h> #include <string.h> int main(void) { char *str = "123456789"; int i = 0, slen = strlen(str); for (; slen > 0; slen -= 2, ++i) printf("%.*s\n", slen, str + i); return 0; }