for 迴圈
基本型
int sum=0; for (int count=1; count<=MAX; count++) { sum+=count; }簡化型
int sum=0; for (int count=1; count<=MAX; count++) sum+=count;省略型
int sum=0, count=1; for ( ; count=1; count<=MAX; count++) sum+=count;單行型
int count, sum; for (count=1, sum=0; count<=MAX; sum+=count, count++);