source:
CIVL/examples/languageFeatures/comma.cvl@
325d439
| Last change on this file since 325d439 was e9aad2c, checked in by , 12 years ago | |
|---|---|
|
|
| File size: 161 bytes | |
| Rev | Line | |
|---|---|---|
| [e9aad2c] | 1 | #include<civlc.h> |
| 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.
