source: CIVL/examples/arithmetic/assoc.cvl@ 97cfc53

1.23 2.0 main test-branch
Last change on this file since 97cfc53 was 793cfc2, checked in by Tim Zirkel <zirkeltk@…>, 13 years ago

Reorganized examples and tests. Added algebra, assoc, dining, assume, and scoping examples.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@163 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 197 bytes
Line 
1#include <civlc.h>
2int n = 3;
3$input double a[n];
4
5void 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.