#973. 求和
求和
说明
输入一个整数 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>�</mi><mo stretchy="false">(</mo><mn>1</mn><mo>≤</mo><mi>�</mi><mo>≤</mo><mn>1</mn><msup><mn>0</mn><mn>7</mn></msup><mo stretchy="false">)</mo></mrow></semantics></math>n(1≤n≤106),每行输出一个数,表示数字 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow></semantics></math>1 到 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>�</mi></mrow></semantics></math>i 的和。
比如,当 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>�</mi><mo>=</mo><mn>5</mn></mrow></semantics></math>n=5 时,
第 1 行输出一个数字 1;
第 2 行输出数字 3,因为 1 + 2 = 3
;
第 3 行输出数字 6,因为 1 + 2 + 3 = 6
;
第 4 行输出数字 10,因为 1 + 2 + 3 + 4 = 10
;
第 5 行输出数字 15,因为 1 + 2 + 3 + 4 + 5 = 15
。
输入格式
输入一个数 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>�</mi><mo stretchy="false">(</mo><mn>1</mn><mo>≤</mo><mi>�</mi><mo>≤</mo><mn>1</mn><msup><mn>0</mn><mn>6</mn></msup><mo stretchy="false">)</mo></mrow></semantics></math>n(1≤n≤106)。
输出格式
输出共 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>�</mi><mo stretchy="false">(</mo><mn>1</mn><mo>≤</mo><mi>�</mi><mo>≤</mo><mn>1</mn><msup><mn>0</mn><mn>6</mn></msup><mo stretchy="false">)</mo></mrow></semantics></math>n(1≤n≤106) 行,每行一个整数。
第 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>�</mi></mrow></semantics></math>i 行输出的数,表示数字 1 到 i 的和。
样例
5
1
3
6
10
15
提示
对于 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>40</mn><mi mathvariant="normal">%</mi></mrow></semantics></math>40% 的数据,<math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>≤</mo><mi>�</mi><mo>≤</mo><mn>10</mn></mrow></semantics></math>1≤n≤10。
对于 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>80</mn><mi mathvariant="normal">%</mi></mrow></semantics></math>80% 的数据,<math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>≤</mo><mi>�</mi><mo>≤</mo><mn>1</mn><msup><mn>0</mn><mn>4</mn></msup></mrow></semantics></math>1≤n≤104。
对于 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>100</mn><mi mathvariant="normal">%</mi></mrow></semantics></math>100% 的数据,<math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>≤</mo><mi>�</mi><mo>≤</mo><mn>1</mn><msup><mn>0</mn><mn>6</mn></msup></mrow></semantics></math>1≤n≤106。
注意:
使用 cout << endl;
输出换行会导致 TLE(超过时间限制)。
请使用 cout << "\n";
或者是 printf("\n");
输出换行。