In the following programs, which one has the different output with the others’?
A、 k=1while (1) {s+=k ;k=k+1;if (k>100) break ;}printf("%d",s);;
B、k=1;Repeat : s+=k ;if (++k<=100)goto Repeatprintf("%d",s);;
C、int k,s=0;for (k=1;k<=100;s+=++k);printf("%d",s);;
D、k=1;do{s+=k;}while (++k<=100);printf("%d",s);
发布时间:2025-06-19 01:14:55