欧美一区二区三区,国内熟女精品熟女A片视频小说,日本av网,小鲜肉男男GAY做受XXX网站

c語(yǔ)言用while和dowhile分別編寫(xiě)一個(gè)求和程序

c語(yǔ)言用while和dowhile分別編寫(xiě)一個(gè)求和程序?

while求和代碼

#include <stdio.h> int main() { int i = 0, sum = 0, n; scanf ("%d", &n); while (i <= n){ sum += i; i++; } printf ("%d ", sum); }

do---while求和代碼

#include <stdio.h> int main() { int i = 0, sum = 0, n; scanf ("%d", &n); do{ sum += i; i++; }while (i <= n); printf ("%d ", sum); }

java while求和,c語(yǔ)言用while和dowhile分別編寫(xiě)一個(gè)求和程序