Compile C
You might have to get clever to do this one.
Start file
int main() { char *s = "Hello, world!"; int i, j; for (i = 0; s[i]; i++) { for (j = 0; j <= i; j++) putchar(s[j]); putchar('\n'); } return 0; }
End file
H He Hel Hell Hello Hello, Hello, Hello, w Hello, wo Hello, wor Hello, worl Hello, world Hello, world!
View Diff
1,13c1,13 < int main() < { < char *s = "Hello, world!"; < int i, j; < < for (i = 0; s[i]; i++) { < for (j = 0; j <= i; j++) < putchar(s[j]); < putchar('\n'); < } < < return 0; < } --- > H > He > Hel > Hell > Hello > Hello, > Hello, > Hello, w > Hello, wo > Hello, wor > Hello, worl > Hello, world > Hello, world!
Solutions by @lvturkeyman:
Unlock 4 remaining solutions by signing in and submitting your own entry