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