////   Cfo  rall   Ver  sion  
 1.0  .0 C  opyr  ight   (C)  
 201  7 Un  iver  sity   of   
Wate  rloo  ////   The   con  
tent  s of   thi  s fi  le a  
re c  over  ed u  nder   the  
 lic  ence   agr  eeme  nt i  
n th  e//   file   "LI  CENC  
E" d  istr  ibut  ed w  ith   
Cfor  all.  ////   fmt  Line  
s.cc   --/  ///   Auth  or    
             : P  eter   A.   
Buhr  // C  reat  ed O  n     
      : Su  n Se  p 17   21:  
56:1  5 20  17//   Las  t Mo  
difi  ed B  y :   Pete  r A.  
 Buh  r//   Last   Mod  ifie  
d On   : F  ri M  ar 2  2 13  
:41:  03 2  019/  / Up  date  
 Cou  nt       :   33/  /#in  
clud  e <f  stre  am.h  fa>#  
incl  ude   <cor  outi  ne.h  
fa>c  orou  tine   For  mat   
{	ch  ar c  h;		  				  				  
	//   used   for   com  muni  
cati  on	i  nt g  , b;  				  
				  			/  / gl  obal   bec  
ause   use  d in   des  truc  
tor}  ;voi  d ?{  }( F  orma  
t &   fmt   ) {      r  esum  
e( f  mt )  ;			  				  			/  
/ st  art   coro  utin  e}vo  
id ^  ?{}(   For  mat   & fm  
t )   {      if   ( fm  t.g   
!= 0   ||   fmt.  b !=   0 )  
 sou  t |   nl;}  void   mai  
n( F  orma  t &   fmt   ) {	  
for   ( ;;   ) {  				  				  
		//   for   as   many   cha  
ract  ers	  	for   ( f  mt.g  
 = 0  ; fm  t.g   < 5;   fmt  
.g +  = 1   ) {	  	//   grou  
ps o  f 5   bloc  ks		  	for  
 ( f  mt.b   = 0  ; fm  t.b   
< 4;   fmt  .b +  = 1   ) {	  
// b  lock  s of   4 c  hara  
cter  s			  	for   ( ;  ; )   
{			  				  // f  or n  ewli  
ne c  hara  cter  s			  		su  
spen  d;		  			i  f (   fmt.  
ch !  = '\  n' )   bre  ak;	  
	//   igno  re n  ewli  ne		  
		}   // f  or		  		so  ut |  
 fmt  .ch;  				  			/  / pr  
int   char  acte  r			  } //  
 for  			s  out   | "    ";	  
				  			/  / pr  int   bloc  
k se  para  tor	  	} /  / fo  
r		s  out   | nl  ;			  				  
		//   pri  nt g  roup   sep  
arat  or	}   //   for}   //   
main  void   prt  ( Fo  rmat  
 & f  mt,   char   ch   ) {   
   f  mt.c  h =   ch;      r  
esum  e( f  mt )  ;} /  / pr  
tint   mai  n()   {	Fo  rmat  
 fmt  ;	ch  ar c  h;	f  or (  
 ;;   ) {	  	sin   | c  h;		  
				  				  // r  ead   one   
char  acte  r	    if (   eof  
( si  n )   ) br  eak;  				  
			/  / eo  f ?	  	prt  ( fm  
t, c  h );  	} /  / fo  r} /  
/ ma  in//   Loc  al V  aria  
bles  : //  // t  ab-w  idth  
: 4   ////   com  pile  -com  
mand  : "c  fa f  mtLi  nes.  
cfa"   ///  / En  d: /  /
