#include typedef struct { void * next; char ch; int g, b; } Fmt; void comain( Fmt * f ) { if ( __builtin_expect(f->next != 0, 1) ) goto *f->next; f->next = &&s1; for ( ;; ) { for ( f->g = 0; f->g < 5; f->g += 1 ) { // groups for ( f->b = 0; f->b < 4; f->b += 1 ) { // blocks return; s1:; while ( f->ch == '\n' ) return; // ignore printf( "%c", f->ch ); // print character } printf( " " ); // block separator } printf( "\n" ); // group separator } } int main() { Fmt fmt = { NULL }; comain( &fmt ); // prime for ( ;; ) { scanf( "%c", &fmt.ch ); // direct read into communication variable if ( feof( stdin ) ) break; comain( &fmt ); } if ( fmt.g != 0 || fmt.b != 0 ) printf( "\n" ); } // Local Variables: // // tab-width: 4 // // compile-command: "gcc-8 Format.c" // // End: //