CSP 2018-3-1 跳一跳

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
using namespace std;

int type;
int grade = 0;
int triple= 1;
int main()
{
while (cin >> type )
{
if (type == 0)
{
cout << grade;
}
else
{
if(type==1)
{
if (grade == 0) grade += 1;
else
{
grade += 1;
triple = 1;
}
}
else
{
grade += 2*triple;
triple += 1;
}
}
}
return 0;
}

CSP 2018-3-2 碰撞的小球 CSP 2019-9-2 买菜

Kommentare

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×