~cpp #include <stdio.h> int main() { int sum=0, n=0; while(1) { n++; sum += n; if(sum >= 3000) break; } printf("n = %d, sum = %d\n",n,sum); return 0; }