|
|
|
|
背景 Background |
|
|
为了for beginngers,特设此题,^_^
|
|
|
|
|
|
|
|
描述 Description |
|
|
已知一数列:1,2,1,2,3,2,1,2,3,4,3,2,1,2,3,4....请根据规律求出第n项的值。例如:n=4 项时,其值为2,n=11时,其值为3. |
|
|
|
|
|
|
|
输入格式 Input Format |
|
|
一个自然数n,(0<n<1000)
|
|
|
|
|
|
|
|
输出格式 Output Format |
|
|
一个整数,即第n项的值。
|
|
|
|
|
|
|
|
时间限制 Time Limitation |
|
|
各个测试点1s
|
|
|
|
|
|
|
|
注释 Hint |
|
|
Free Pascal Code:
-------------------
program Plus;
var a,b:longint;
begin
readln(a,b);
writeln(a+b);
end.
C++ Code:
-------------------
#include <iostream>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
cout<<a+b<<endl;
return 0;
}
|
|
|
|
|
|
|
|
|
Flag |
|
题号 |
P1044 |
|
其它 |
通过 |
42人 |
提交 |
176次 |
通过率 |
24% |
难度 |
0 |
|
|
|
|
|
|