NEUQ-ACMclub 2018暑期编程训练营 结课测试标程

NEUQ OJ contest-1393
由于题目难度较低,本文只提供标程,没有题解,若有不理解可在QQ群提问(798317227)

A.俱乐部招新

1
2
3
4
5
6
7
8
9
#include <iostream>

using namespace std;

int main()
{
cout<<"I am great, and I will never become a pigeon!";
return 0;
}

B.在学习中等待

1
2
3
4
5
6
7
8
9
10
11
#include <iostream>

using namespace std;

int main()
{
int a,b;
cin>>a>>b;
cout<<a*b;
return 0;
}

C.驾考科目二

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>

using namespace std;

int main()
{
int s=100;
for(int i=0;i<5;i++)
{
int x;
cin>>x;
s-=x;
}
if(s>=80)
{
cout<<"passed";
}
else
{
cout<<"failed";
}
return 0;
}

D.决战综合楼之巅

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 main()
{
string name1,name2;
int a1,a2,t1,t2;
cin>>name1>>a1>>t1>>name2>>a2>>t2;
if(a1>a2)
{
cout<<name1;
}
else if(a1<a2)
{
cout<<name2;
}
else
{
if(t1<t2)
{
cout<<name1;
}
else if(t1>t2)
{
cout<<name2;
}
else
{
cout<<"Oops!";
}
}
return 0;
}

E.军训列队

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
#include <iostream>

using namespace std;

int main()
{
int n,wd,h[10],t=1;
cin>>n>>wd;
for(int i=1;i<=n;i++)
{
cin>>h[i];
if(wd>h[i])
{
t++;
}
}
cout<<t<<endl;
for(int i=1;i<t;i++)
{
cout<<h[i]<<' ';
}
cout<<wd;
for(int i=t;i<=n;i++)
{
cout<<' '<<h[i];
}
return 0;
}

F.课程宣传

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>

using namespace std;

int person(int n)
{
if(n==0||n==1)
{
return n;
}
else
{
return person(n-1)*2+person(n-2)*3;
}
}

int main()
{
int n;
cin>>n;
cout<<person(n);
return 0;
}