source:
tests/io1.cfa
@
b5276fc
Last change on this file since b5276fc was 17a1b21, checked in by , 6 years ago | |
---|---|
|
|
File size: 1.6 KB |
Rev | Line | |
---|---|---|
[73abe95] | 1 | // |
[ef3403c6] | 2 | // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo |
3 | // | |
4 | // The contents of this file are covered under the licence agreement in the | |
5 | // file "LICENCE" distributed with Cforall. | |
[73abe95] | 6 | // |
[dc8511c] | 7 | // io1.cfa -- |
[73abe95] | 8 | // |
[ef3403c6] | 9 | // Author : Peter A. Buhr |
10 | // Created On : Wed Mar 2 16:56:02 2016 | |
11 | // Last Modified By : Peter A. Buhr | |
[17a1b21] | 12 | // Last Modified On : Mon Mar 4 21:42:47 2019 |
13 | // Update Count : 115 | |
[73abe95] | 14 | // |
[ef3403c6] | 15 | |
[73abe95] | 16 | #include <fstream.hfa> |
[ef3403c6] | 17 | |
18 | int main() { | |
19 | int x = 3, y = 5, z = 7; | |
[200fcb3] | 20 | sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2); |
[17a1b21] | 21 | sout | 0 | 1 | 2 | 3; |
22 | sout | '0' | '1' | '2' | '3'; | |
23 | sout | 0 | "" | 1 | "" | 2 | "" | 3; | |
[5ea5b28] | 24 | sout | nl; |
[ef3403c6] | 25 | |
[5ea5b28] | 26 | sout | nlOff; |
27 | sout | "opening delimiters" | nl; | |
28 | sout | "x (" | 1; | |
29 | sout | "x [" | 2; | |
30 | sout | "x {" | 3; | |
31 | sout | "x =" | 4; | |
32 | sout | "x $" | 5; | |
33 | sout | "x £" | 6; | |
34 | sout | "x ¥" | 7; | |
35 | sout | "x ¡" | 8; | |
36 | sout | "x ¿" | 9; | |
[7cccc20] | 37 | sout | "x «" | 10; |
[5ea5b28] | 38 | sout | nl | nl; |
[ef3403c6] | 39 | |
[5ea5b28] | 40 | sout | "closing delimiters" | nl; |
41 | sout | 1 | ", x"; | |
42 | sout | 2 | ". x"; | |
43 | sout | 3 | "; x"; | |
44 | sout | 4 | "! x"; | |
45 | sout | 5 | "? x"; | |
46 | sout | 6 | "% x"; | |
47 | sout | 7 | "¢ x"; | |
48 | sout | 8 | "» x"; | |
49 | sout | 9 | ") x"; | |
50 | sout | 10 | "] x"; | |
[7cccc20] | 51 | sout | 11 | "} x"; |
[5ea5b28] | 52 | sout | nl | nl; |
[ef3403c6] | 53 | |
[5ea5b28] | 54 | sout | "opening/closing delimiters" | nl; |
55 | sout | "x`" | 1 | "`x'" | 2; | |
56 | sout | "'x\"" | 3 | "\"x:" | 4; | |
57 | sout | ":x " | 5 | " x\t" | 6; | |
58 | sout | "\tx\f" | 7 | "\fx\v" | 8; | |
59 | sout | "\vx\n" | 9 | "\nx\r" | 10; | |
[7cccc20] | 60 | sout | "\rx"; |
[5ea5b28] | 61 | sout | nl | nl; |
[ef3403c6] | 62 | |
[5ea5b28] | 63 | sout | nlOn; |
[200fcb3] | 64 | sout | "override opening/closing delimiters"; |
65 | sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4; | |
[5ea5b28] | 66 | sout | nl; |
[ef3403c6] | 67 | } |
68 | ||
69 | // Local Variables: // | |
70 | // tab-width: 4 // | |
[dc8511c] | 71 | // compile-command: "cfa io1.cfa" // |
[ef3403c6] | 72 | // End: // |
Note: See TracBrowser
for help on using the repository browser.