[ca8824d] | 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 |
---|
[329487c] | 9 | // Last Modified On : Mon Aug 14 17:38:52 2023 |
---|
| 10 | // Update Count : 63 |
---|
[ca8824d] | 11 | // |
---|
| 12 | |
---|
| 13 | #include <fstream.hfa> |
---|
| 14 | #include <stdio.h> // scanf |
---|
| 15 | |
---|
| 16 | int main() { |
---|
| 17 | { |
---|
| 18 | char s[] = "yyyyyyyyyyyyyyyyyyyy"; |
---|
[dc5072f] | 19 | const char sk[] = "abc"; |
---|
| 20 | scanf( "abc " ); scanf( sk ); for ( 5 ) scanf( "%*c" ); printf( "1 %s\n", s ); |
---|
[329487c] | 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 ); |
---|
[ca8824d] | 34 | } |
---|
| 35 | { |
---|
| 36 | char s[] = "yyyyyyyyyyyyyyyyyyyy"; |
---|
[dc5072f] | 37 | char sk[] = "abc"; |
---|
[329487c] | 38 | sin /*| "abc "*/ | skip( sk ) | skip( 5 ); sout | "1" | s; |
---|
| 39 | sin | wdi( sizeof(s), s ); sout | "2" | s; |
---|
| 40 | sin | ignore( s ); sout | "3" | s; |
---|
| 41 | sin | wdi( sizeof(s), 8, s ); sout | "4" | s; |
---|
| 42 | sin | ignore( wdi( sizeof(s), 8, s ) ); sout | "5" | s; |
---|
| 43 | |
---|
| 44 | sin | incl( "abc", wdi( sizeof(s), s ) ); sout | "6" | s; |
---|
| 45 | sin | excl( "abc", wdi( sizeof(s), s ) ); sout | "7" | s; |
---|
[74c6748] | 46 | sin | ignore( incl( "abc", wdi( sizeof(s), s ) ) ); sout | "8" | s; |
---|
| 47 | sin | ignore( excl( "abc", wdi( sizeof(s), s ) ) ); sout | "9" | s; |
---|
[329487c] | 48 | sin | incl( "abc", wdi( sizeof(s), 8, s ) ); sout | "10" | s; |
---|
| 49 | sin | excl( "abc", wdi( sizeof(s), 8, s ) ); sout | "11" | s; |
---|
| 50 | sin | ignore( incl( "abc", wdi( sizeof(s), 8, s ) ) ); sout | "12" | s; |
---|
| 51 | sin | ignore( excl( "abc", wdi( sizeof(s), 8, s ) ) ); sout | "13" | s; |
---|
[ca8824d] | 52 | } |
---|
| 53 | { |
---|
| 54 | char c; |
---|
[329487c] | 55 | sin | c; sout | c; |
---|
| 56 | sin | ignore( c ); sout | c; |
---|
[ca8824d] | 57 | |
---|
| 58 | signed char sc; |
---|
[329487c] | 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; |
---|
[ca8824d] | 63 | |
---|
| 64 | unsigned char usc; |
---|
[329487c] | 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; |
---|
[ca8824d] | 69 | |
---|
| 70 | signed short int ssi; |
---|
[329487c] | 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; |
---|
[ca8824d] | 75 | |
---|
| 76 | unsigned short int usi; |
---|
[329487c] | 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; |
---|
[ca8824d] | 81 | |
---|
| 82 | signed int si; |
---|
[329487c] | 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; |
---|
[ca8824d] | 87 | |
---|
| 88 | unsigned int ui; |
---|
[329487c] | 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; |
---|
[ca8824d] | 93 | |
---|
| 94 | signed long int sli; |
---|
[329487c] | 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; |
---|
[ca8824d] | 99 | |
---|
| 100 | unsigned long int uli; |
---|
[329487c] | 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; |
---|
[ca8824d] | 105 | |
---|
| 106 | signed long long int slli; |
---|
[329487c] | 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; |
---|
[ca8824d] | 111 | |
---|
| 112 | unsigned long long int ulli; |
---|
[329487c] | 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; |
---|
[ca8824d] | 117 | |
---|
| 118 | float f; |
---|
[329487c] | 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; |
---|
[ca8824d] | 123 | |
---|
| 124 | double d; |
---|
[329487c] | 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; |
---|
[ca8824d] | 129 | |
---|
| 130 | long double ld; |
---|
[329487c] | 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; |
---|
[ca8824d] | 135 | |
---|
| 136 | float _Complex fc; |
---|
[329487c] | 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; |
---|
[ca8824d] | 141 | |
---|
| 142 | double _Complex dc; |
---|
[329487c] | 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; |
---|
[ca8824d] | 147 | |
---|
| 148 | long double _Complex ldc; |
---|
[329487c] | 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; |
---|
[ca8824d] | 153 | } |
---|
[6527150] | 154 | #if defined( __SIZEOF_INT128__ ) |
---|
[20f5eb8] | 155 | { |
---|
| 156 | int128 val; |
---|
| 157 | for ( 15 ) { |
---|
| 158 | sin | val; |
---|
| 159 | sout | val; |
---|
| 160 | } |
---|
| 161 | } |
---|
[6527150] | 162 | #endif // __SIZEOF_INT128__ |
---|
[ca8824d] | 163 | } // main |
---|
| 164 | |
---|
| 165 | // Local Variables: // |
---|
| 166 | // tab-width: 4 // |
---|
[dc5072f] | 167 | // compile-command: "cfa -Wall -Wextra manipulatorsInput.cfa" // |
---|
[ca8824d] | 168 | // End: // |
---|