[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 |
---|
[dc5072f] | 9 | // Last Modified On : Thu Jun 13 17:41:43 2019 |
---|
| 10 | // Update Count : 37 |
---|
[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 ); |
---|
| 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"; |
---|
| 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; |
---|
[ca8824d] | 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; |
---|
[dc5072f] | 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; |
---|
[ca8824d] | 52 | } |
---|
| 53 | { |
---|
| 54 | char c; |
---|
[dc5072f] | 55 | sin | c; sout | c; |
---|
| 56 | sin | ignore( c ); sout | c; |
---|
[ca8824d] | 57 | |
---|
| 58 | signed char sc; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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; |
---|
[dc5072f] | 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 | } |
---|
| 154 | } // main |
---|
| 155 | |
---|
| 156 | // Local Variables: // |
---|
| 157 | // tab-width: 4 // |
---|
[dc5072f] | 158 | // compile-command: "cfa -Wall -Wextra manipulatorsInput.cfa" // |
---|
[ca8824d] | 159 | // End: // |
---|