source:
CIVL/examples/arithmetic/division.cvl@
97cfc53
| Last change on this file since 97cfc53 was 95a2a9e, checked in by , 13 years ago | |
|---|---|
|
|
| File size: 185 bytes | |
| Rev | Line | |
|---|---|---|
| [95a2a9e] | 1 | #include<assert.h> |
| 2 | ||
| 3 | $input int N; | |
| 4 | $input int a[N]; | |
| 5 | ||
| 6 | void main() { | |
| 7 | double x = 0.0; | |
| 8 | double s; | |
| 9 | ||
| 10 | $assume N >= 2 && N <= 4; | |
| 11 | x = x + a[0]+a[1]; | |
| 12 | s = x/N; | |
| 13 | $assert N*s==a[0]+a[1]; | |
| 14 | } |
Note:
See TracBrowser
for help on using the repository browser.
