⬆️ ⬇️

The house that Jack built

Habr does not allow to publish the text of the program without stuffing it under the cat, or without breaking it with the cat, this is very sad - read under the cat:



Update: The program prints a well-known poem, I tried to make it as short as possible, and so far I don’t see how it can be cleared up - it would be nice to go up to 1000 characters - then the cat would not be necessary.



#include <stdio.h> int main(int s) { switch (s) { case 1: printf(" ,\n"); break; case 2: printf("\n  ,\n"); break; case 3: printf("\n   -,\n"); break; case 4: printf("\n ,\n"); break; case 5: printf("\n   ,\n"); break; case 6: printf("\n   ,\n"); break; case 7: printf("\n  ,   ,\n"); break; case 8: printf("\n     ,\n"); } switch (s) { case 9: printf("\n  ,\n   ,\n"); case 8: printf("    ,\n"); case 7: printf("   ,\n"); case 6: printf("    ,\n"); case 5: printf("    ,\n"); case 4: printf("    ,\n"); case 3: printf("   ,\n"); case 2: printf("    \n ,\n"); case 1: printf("  .\n"); } if (s++<9) main(s); } 


')

Source: https://habr.com/ru/post/446960/



All Articles