Run ID:93506

提交时间:2024-10-17 14:20:02

#include <stdio.h> int main() { int s=0; int i=1; while(1) { s = s+i; if(s>1000) break; i +=1; } printf("%d",i); return 0; } /* 1+2+……+45 tot = (1+45)*45/2 = 23*45 = 1035 1035-45= 990 1+2+……+44 */