source:
tests/io1.cfa
@
5ebb1368
Last change on this file since 5ebb1368 was 200fcb3, checked in by , 6 years ago | |
---|---|
|
|
File size: 1.4 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 | |
[200fcb3] | 12 | // Last Modified On : Tue Dec 4 21:40:28 2018 |
13 | // Update Count : 106 | |
[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); |
21 | sout | 1 | 2 | 3; | |
22 | sout | '1' | '2' | '3'; | |
23 | sout | 1 | "" | 2 | "" | 3; | |
24 | sout; | |
[ef3403c6] | 25 | |
[200fcb3] | 26 | sout | "opening delimiters"; |
[ef3403c6] | 27 | sout |
28 | | "x (" | 1 | |
29 | | "x [" | 2 | |
30 | | "x {" | 3 | |
31 | | "x =" | 4 | |
32 | | "x $" | 5 | |
[58b6d1b] | 33 | | "x £" | 6 |
34 | | "x ¥" | 7 | |
35 | | "x ¡" | 8 | |
36 | | "x ¿" | 9 | |
37 | | "x «" | 10 | |
[200fcb3] | 38 | | nl; |
[ef3403c6] | 39 | |
[200fcb3] | 40 | sout | "closing delimiters"; |
[ef3403c6] | 41 | sout |
42 | | 1 | ", x" | |
43 | | 2 | ". x" | |
44 | | 3 | "; x" | |
45 | | 4 | "! x" | |
46 | | 5 | "? x" | |
47 | | 6 | "% x" | |
[58b6d1b] | 48 | | 7 | "¢ x" |
49 | | 8 | "» x" | |
[ef3403c6] | 50 | | 9 | ") x" |
51 | | 10 | "] x" | |
52 | | 11 | "} x" | |
[200fcb3] | 53 | | nl; |
[ef3403c6] | 54 | |
[200fcb3] | 55 | sout | "opening/closing delimiters"; |
[ef3403c6] | 56 | sout |
57 | | "x`" | 1 | "`x'" | 2 | |
58 | | "'x\"" | 3 | "\"x:" | 4 | |
59 | | ":x " | 5 | " x\t" | 6 | |
60 | | "\tx\f" | 7 | "\fx\v" | 8 | |
61 | | "\vx\n" | 9 | "\nx\r" | 10 | |
62 | | "\rx" | |
[200fcb3] | 63 | | nl; |
[ef3403c6] | 64 | |
[200fcb3] | 65 | sout | "override opening/closing delimiters"; |
66 | sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4; | |
67 | sout; | |
[ef3403c6] | 68 | } |
69 | ||
70 | // Local Variables: // | |
71 | // tab-width: 4 // | |
[dc8511c] | 72 | // compile-command: "cfa io1.cfa" // |
[ef3403c6] | 73 | // End: // |
Note: See TracBrowser
for help on using the repository browser.