Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5983 邓小龙 15加到第几项 C++ Wrong Answer 0 MS 260 KB 397 2024-12-28 09:09:40

Tests(0/1):


Code:

#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int s=0,n=1; while(s<=1000){ s+=n; cout<<n<<" "<<s<<endl; n++; } cout<<n-1<<endl; return 0; }


Run Info:

------Input------
0
------Answer-----
45
------Your output-----
1 1 2 3 3 6 4 10 5 15 6 21 7 28 8 36 9 45 10 55 11 66 12 78 13 91 14 105 15 120 16 136 17 153 18 171 19 190 20 210 21 231 22 253 23 276 24 300 25 325 26 351 27 378 28 406 29 435 30 465 31 496 32 528 33 561 34 595 35 630 36 666 37 703 38 741 39 780 40 820 41 861 42 903 43 946 44 990 45 1035 45