source:
CIVL/examples/languageFeatures/comma.cvl@
a6d2043
| Last change on this file since a6d2043 was d980649, checked in by , 10 years ago | |
|---|---|
|
|
| File size: 163 bytes | |
| Line | |
|---|---|
| 1 | #include<civlc.cvh> |
| 2 | |
| 3 | $input int n; |
| 4 | |
| 5 | void main() { |
| 6 | int i,j, k; |
| 7 | |
| 8 | k = 0; |
| 9 | for (i=0, j=1; i<=n; i++,j++) { |
| 10 | k += i*j; |
| 11 | } |
| 12 | $assert(k == n*(n+1)*(n+2)/3); |
| 13 | } |
Note:
See TracBrowser
for help on using the repository browser.
