source:
CIVL/examples/languageFeatures/comma.cvl@
025cc4f
| Last change on this file since 025cc4f was 3ff27cf, checked in by , 11 years ago | |
|---|---|
|
|
| File size: 165 bytes | |
| Rev | Line | |
|---|---|---|
| [e6b02c8] | 1 | #include<civlc.cvh> |
| [e9aad2c] | 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 | } | |
| [3ff27cf] | 12 | $assert((k == n*(n+1)*(n+2)/3)); |
| [e9aad2c] | 13 | } |
Note:
See TracBrowser
for help on using the repository browser.
