Last change
on this file since df2e00f was
3ac5fd8,
checked in by Peter A. Buhr <pabuhr@…>, 9 days ago
|
first attempt changing end-of-file to an exception
|
-
Property mode set to
100644
|
File size:
2.4 KB
|
Line | |
---|
1 | //// Cfo rall Ver sion |
---|
2 | 1.0 .0 C opyr ight (C) |
---|
3 | 201 7 Un iver sity of |
---|
4 | Wate rloo //// The con |
---|
5 | tent s of thi s fi le a |
---|
6 | re c over ed u nder the |
---|
7 | lic ence agr eeme nt i |
---|
8 | n th e// file "LI CENC |
---|
9 | E" d istr ibut ed w ith |
---|
10 | Cfor all. //// fmt Line |
---|
11 | s.cf a -- for mat char |
---|
12 | acte rs i nto bloc ks o |
---|
13 | f 4 and grou ps o f 5 |
---|
14 | bloc ks p er l ine/ /// |
---|
15 | Auth or : T |
---|
16 | hier ry D elis le// Cre |
---|
17 | ated On : Thu |
---|
18 | Mar 5 1 6:09 :08 2020 |
---|
19 | // L ast Modi fied By |
---|
20 | : Pe ter A. B uhr/ / La |
---|
21 | st M odif ied On : Sat |
---|
22 | Aug 17 14:2 1:28 202 |
---|
23 | 4// Upda te C ount |
---|
24 | : 5 //#i nclu de < fstr |
---|
25 | eam. hfa> gene rato r Fo |
---|
26 | rmat { c har ch; |
---|
27 | // use d fo r co |
---|
28 | mmun icat ion int g, b |
---|
29 | ; // g loba |
---|
30 | l be caus e us ed i n de |
---|
31 | stru ctor };vo id m ain( |
---|
32 | For mat & fm t ) with |
---|
33 | ( fm t ) { fo r () { |
---|
34 | // for as m |
---|
35 | any char acte rs for |
---|
36 | ( g = 0; g < 5; g += |
---|
37 | 1 ) { / / gr oups |
---|
38 | of 5 bl ocks f or ( |
---|
39 | b = 0; b < 4; b += |
---|
40 | 1 ) { // bloc ks o |
---|
41 | f 4 char acte rs fo |
---|
42 | r () { // for |
---|
43 | new line cha ract ers |
---|
44 | susp end; if |
---|
45 | ( c h != '\n ' ) brea |
---|
46 | k; // ign ore newl |
---|
47 | ine } // for s |
---|
48 | out | ch ; // |
---|
49 | prin t ch arac ter } |
---|
50 | // f or sou t | " " |
---|
51 | ; // prin t bl |
---|
52 | ock sepa rato r } // |
---|
53 | for sou t | nl; |
---|
54 | // prin t gr oup |
---|
55 | sepa rato r } // f or} |
---|
56 | // m ainv oid ?{}( For |
---|
57 | mat & fm t ) { re sume |
---|
58 | ( fm t ); // |
---|
59 | pri me ( star t) c orou |
---|
60 | tine }voi d ^? {}( Form |
---|
61 | at & fmt ) w ith( fmt |
---|
62 | ) { if ( g != 0 || |
---|
63 | b != 0 ) sou t | nl;} |
---|
64 | void for mat( For mat |
---|
65 | & fm t ) { re sume ( fm |
---|
66 | t ); } // for mati nt m |
---|
67 | ain( ) { Form at f mt; |
---|
68 | sout | n lOff ; |
---|
69 | / / tu rn o ff a uto |
---|
70 | newl ine try { f or ( |
---|
71 | ) { // read |
---|
72 | unt il e nd o f fi le |
---|
73 | sin | f mt.c h; |
---|
74 | // rea d on e ch arac |
---|
75 | ter fo rmat ( fm t ); |
---|
76 | // p ush char |
---|
77 | acte r fo r fo rmat ting |
---|
78 | } // f or } cat ch( |
---|
79 | end_ of_f ile * ) { } |
---|
80 | // t ry} // m ain |
---|
Note: See
TracBrowser
for help on using the repository browser.