1 | // |
---|
2 | // Cforall Version 1.0.0 Copyright (C) 2019 University of Waterloo |
---|
3 | // |
---|
4 | // manipulatorsInput.cfa -- |
---|
5 | // |
---|
6 | // Author : Peter A. Buhr |
---|
7 | // Created On : Sat Jun 8 17:58:54 2019 |
---|
8 | // Last Modified By : Peter A. Buhr |
---|
9 | // Last Modified On : Wed Jul 15 15:56:03 2020 |
---|
10 | // Update Count : 47 |
---|
11 | // |
---|
12 | |
---|
13 | #include <fstream.hfa> |
---|
14 | #include <stdio.h> // scanf |
---|
15 | |
---|
16 | int main() { |
---|
17 | { |
---|
18 | char s[] = "yyyyyyyyyyyyyyyyyyyy"; |
---|
19 | const char sk[] = "abc"; |
---|
20 | scanf( "abc " ); scanf( sk ); for ( 5 ) scanf( "%*c" ); printf( "1 %s\n", s ); |
---|
21 | scanf( "%s", s ); printf( "2 %s\n", s ); |
---|
22 | scanf( "%*s" ); printf( "3 %s\n", s ); |
---|
23 | scanf( "%8s", s ); printf( "4 %s\n", s ); |
---|
24 | scanf( "%*8s" ); printf( "5 %s\n", s ); |
---|
25 | |
---|
26 | scanf( "%[abc]", s ); printf( "6 %s\n", s ); |
---|
27 | scanf( "%[^abc]", s ); printf( "7 %s\n", s ); |
---|
28 | scanf( "%*[abc]" ); printf( "8 %s\n", s ); |
---|
29 | scanf( "%*[^abc]" ); printf( "9 %s\n", s ); |
---|
30 | scanf( "%8[abc]", s ); printf( "10 %s\n", s ); |
---|
31 | scanf( "%8[^abc]", s ); printf( "11 %s\n", s ); |
---|
32 | scanf( "%*8[abc]" ); printf( "12 %s\n", s ); |
---|
33 | scanf( "%*8[^abc]" ); printf( "13 %s\n", s ); |
---|
34 | } |
---|
35 | { |
---|
36 | char s[] = "yyyyyyyyyyyyyyyyyyyy"; |
---|
37 | char sk[] = "abc"; |
---|
38 | sin /*| "abc "*/ | skip( sk ) | skip( 5 ); sout | "1" | s; |
---|
39 | sin | s; sout | "2" | s; |
---|
40 | sin | ignore( s ); sout | "3" | s; |
---|
41 | sin | wdi( 8, s ); sout | "4" | s; |
---|
42 | sin | ignore( wdi( 8, s ) ); sout | "5" | s; |
---|
43 | |
---|
44 | sin | incl( "abc", s ); sout | "6" | s; |
---|
45 | sin | excl( "abc", s ); sout | "7" | s; |
---|
46 | sin | ignore( incl( "abc", s ) ); sout | "8" | s; |
---|
47 | sin | ignore( excl( "abc", s ) ); sout | "9" | s; |
---|
48 | sin | wdi( 8, incl( "abc", s ) ); sout | "10" | s; |
---|
49 | sin | wdi( 8, excl( "abc", s ) ); sout | "11" | s; |
---|
50 | sin | ignore( wdi( 8, incl( "abc", s ) ) ); sout | "12" | s; |
---|
51 | sin | ignore( wdi( 8, excl( "abc", s ) ) ); sout | "13" | s; |
---|
52 | } |
---|
53 | { |
---|
54 | char c; |
---|
55 | sin | c; sout | c; |
---|
56 | sin | ignore( c ); sout | c; |
---|
57 | |
---|
58 | signed char sc; |
---|
59 | sin | sc; sout | sc; |
---|
60 | sin | wdi( 3, sc ); sout | sc; |
---|
61 | sin | ignore( sc ); sout | sc; |
---|
62 | sin | ignore( wdi( 3, sc ) ); sout | sc; |
---|
63 | |
---|
64 | unsigned char usc; |
---|
65 | sin | usc; sout | usc; |
---|
66 | sin | wdi( 3, usc ); sout | usc; |
---|
67 | sin | ignore( usc ); sout | usc; |
---|
68 | sin | ignore( wdi( 3, usc ) ); sout | usc; |
---|
69 | |
---|
70 | signed short int ssi; |
---|
71 | sin | ssi; sout | ssi; |
---|
72 | sin | wdi( 3, ssi ); sout | ssi; |
---|
73 | sin | ignore( ssi ); sout | ssi; |
---|
74 | sin | ignore( wdi( 3, ssi ) ); sout | ssi; |
---|
75 | |
---|
76 | unsigned short int usi; |
---|
77 | sin | usi; sout | usi; |
---|
78 | sin | wdi( 3, usi ); sout | usi; |
---|
79 | sin | ignore( usi ); sout | usi; |
---|
80 | sin | ignore( wdi( 3, usi ) ); sout | usi; |
---|
81 | |
---|
82 | signed int si; |
---|
83 | sin | si; sout | si; |
---|
84 | sin | wdi( 3, si ); sout | si; |
---|
85 | sin | ignore( si ); sout | si; |
---|
86 | sin | ignore( wdi( 3, si ) ); sout | si; |
---|
87 | |
---|
88 | unsigned int ui; |
---|
89 | sin | ui; sout | ui; |
---|
90 | sin | wdi( 3, ui ); sout | ui; |
---|
91 | sin | ignore( ui ); sout | ui; |
---|
92 | sin | ignore( wdi( 3, ui ) ); sout | ui; |
---|
93 | |
---|
94 | signed long int sli; |
---|
95 | sin | sli; sout | sli; |
---|
96 | sin | wdi( 3, sli ); sout | sli; |
---|
97 | sin | ignore( sli ); sout | sli; |
---|
98 | sin | ignore( wdi( 3, sli ) ); sout | sli; |
---|
99 | |
---|
100 | unsigned long int uli; |
---|
101 | sin | uli; sout | uli; |
---|
102 | sin | wdi( 3, uli ); sout | uli; |
---|
103 | sin | ignore( uli ); sout | uli; |
---|
104 | sin | ignore( wdi( 3, uli ) ); sout | uli; |
---|
105 | |
---|
106 | signed long long int slli; |
---|
107 | sin | slli; sout | slli; |
---|
108 | sin | wdi( 3, slli ); sout | slli; |
---|
109 | sin | ignore( slli ); sout | slli; |
---|
110 | sin | ignore( wdi( 3, slli ) ); sout | slli; |
---|
111 | |
---|
112 | unsigned long long int ulli; |
---|
113 | sin | ulli; sout | ulli; |
---|
114 | sin | wdi( 3, ulli ); sout | ulli; |
---|
115 | sin | ignore( ulli ); sout | ulli; |
---|
116 | sin | ignore( wdi( 3, ulli ) ); sout | ulli; |
---|
117 | |
---|
118 | float f; |
---|
119 | sin | f; sout | f; |
---|
120 | sin | wdi( 8, f ); sout | f; |
---|
121 | sin | ignore( f ); sout | f; |
---|
122 | sin | ignore( wdi( 8, f ) ); sout | f; |
---|
123 | |
---|
124 | double d; |
---|
125 | sin | d; sout | d; |
---|
126 | sin | wdi( 8, d ); sout | d; |
---|
127 | sin | ignore( d ); sout | d; |
---|
128 | sin | ignore( wdi( 8, d ) ); sout | d; |
---|
129 | |
---|
130 | long double ld; |
---|
131 | sin | ld; sout | ld; |
---|
132 | sin | wdi( 8, ld ); sout | ld; |
---|
133 | sin | ignore( ld ); sout | ld; |
---|
134 | sin | ignore( wdi( 8, ld ) ); sout | ld; |
---|
135 | |
---|
136 | float _Complex fc; |
---|
137 | sin | fc; sout | fc; |
---|
138 | sin | wdi( 8, fc ); sout | fc; |
---|
139 | sin | ignore( fc ); sout | fc; |
---|
140 | sin | ignore( wdi( 8, fc ) ); sout | fc; |
---|
141 | |
---|
142 | double _Complex dc; |
---|
143 | sin | dc; sout | dc; |
---|
144 | sin | wdi( 8, dc ); sout | dc; |
---|
145 | sin | ignore( dc ); sout | dc; |
---|
146 | sin | ignore( wdi( 8, dc ) ); sout | dc; |
---|
147 | |
---|
148 | long double _Complex ldc; |
---|
149 | sin | ldc; sout | ldc; |
---|
150 | sin | wdi( 8, ldc ); sout | ldc; |
---|
151 | sin | ignore( ldc ); sout | ldc; |
---|
152 | sin | ignore( wdi( 8, ldc ) ); sout | ldc; |
---|
153 | } |
---|
154 | #if defined( __SIZEOF_INT128__ ) |
---|
155 | { |
---|
156 | int128 val; |
---|
157 | for ( 15 ) { |
---|
158 | sin | val; |
---|
159 | sout | val; |
---|
160 | } |
---|
161 | } |
---|
162 | #endif // __SIZEOF_INT128__ |
---|
163 | } // main |
---|
164 | |
---|
165 | // Local Variables: // |
---|
166 | // tab-width: 4 // |
---|
167 | // compile-command: "cfa -Wall -Wextra manipulatorsInput.cfa" // |
---|
168 | // End: // |
---|