source:
CIVL/examples/arithmetic/assoc.cvl@
97cfc53
| Last change on this file since 97cfc53 was 793cfc2, checked in by , 13 years ago | |
|---|---|
|
|
| File size: 197 bytes | |
| Rev | Line | |
|---|---|---|
| [793cfc2] | 1 | #include <civlc.h> |
| 2 | int n = 3; | |
| 3 | $input double a[n]; | |
| 4 | ||
| 5 | void main() { | |
| 6 | double s0 = 0.0; | |
| 7 | double s1 = 0.0; | |
| 8 | for (int i = 0; i < n; i++) { | |
| 9 | s0 += a[i]; | |
| 10 | s1 += a[n-1-i]; | |
| 11 | } | |
| 12 | $assert s0 == s1; | |
| 13 | } |
Note:
See TracBrowser
for help on using the repository browser.
