source:
CIVL/mods/dev.civl.abc/examples/adder_seq.c
| Last change on this file was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 258 bytes | |
| Line | |
|---|---|
| 1 | #pragma TASS input int B |
| 2 | #define B 10 |
| 3 | #pragma TASS input {n>=0 && n<=B} int n |
| 4 | #define n 10 |
| 5 | #pragma TASS input |
| 6 | double a[n]; |
| 7 | #pragma TASS output |
| 8 | double sum; |
| 9 | |
| 10 | void main() { |
| 11 | double result = 0.0; |
| 12 | int i; |
| 13 | |
| 14 | for (i=0; i<n; i++) result += a[i]; |
| 15 | sum = result; |
| 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
