团体程序设计天梯赛--5分题
L1-001 Hello World!
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"Hello World!";
return 0;
}
L1-004 计算摄氏温度
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a;
b=5*(a-32)/9;
cout<<"Celsius = "<<b;
return 0;
}
L1-012 计算指数
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,x;
cin>>n;
x=pow(2,n);
cout<<"2^"<<n<<" = "<<x;
return 0;
}
L1-014 简单题
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"This is a simple problem.";
return 0;
}
L1-021 重要的话说三遍
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"I'm gonna WIN!\nI'm gonna WIN!\nI'm gonna WIN!\n";
return 0;
}
L1-024 后天
#include<bits/stdc++.h>
using namespace std;
int main(){
int d;
cin>>d;
if(d>=6)cout<<(d+2)%7;
else cout<<d+2;
return 0;
}
L1-026 I Love GPLT
#include<bits/stdc++.h>
using namespace std;
int main(){
printf("I\n \nL\no\nv\ne\n \nG\nP\nL\nT");
return 0;
}
L1-029 是不是太胖了
#include<bits/stdc++.h>
using namespace std;
int main(){
int h;double w;
cin>>h;
w=(h-100)*0.9*2;
printf("%.1f",w);
return 0;
}
L1-036 A乘以B
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
cout<<a*b;
return 0;
}
L1-038 新世界
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"Hello World\nHello New World";
return 0;
}
L1-042 日期格式化
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
scanf("%d-%d-%d",&a,&b,&c);
printf("%d-%02d-%02d",c,a,b);
return 0;
}
L1-045 宇宙无敌大招呼
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
cout<<"Hello "<<s;
return 0;
}
L1-051 打折
#include<bits/stdc++.h>
using namespace std;
int main(){
double a,b;
cin>>a>>b;
printf("%.2f",a*b/10.0);
return 0;
}
L1-052 2018我们要赢
#include<bits/stdc++.h>
using namespace std;
int main(){
printf("2018\nwo3 men2 yao4 ying2 !");
return 0;
}
L1-057 PTA使我精神焕发
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"PTA shi3 wo3 jing1 shen2 huan4 fa1 !";
return 0;
}
L1-060 心理阴影面积
#include<bits/stdc++.h>
using namespace std;
int main(){
int x,y;
cin>>x>>y;
cout<<5000-(x*y/2+(100-x)*(y+100)/2);
return 0;
}
L1-065 嫑废话上代码
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"Talk is cheap. Show me the code.";
return 0;
}
L1-066 猫是液体
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
cout<<a*b*c;
return 0;
}
L1-073 人与神
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"To iterate is human, to recurse divine.";
return 0;
}
L1-074 两小时学完C语言
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
a=a-b*c;
cout<<a;
return 0;
}
L1-081 今天我要赢
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"I'm gonna win! Today!\n2022-04-23";
return 0;
}
L1-082 种钻石
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
cout<<a/b;
return 0;
}
L4-109 考试周
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
printf("%d/%.1f=%d",a,b,a*1.0/b);
return 0;
}
L4-114 自动编程
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
cout<<"print("<<n<<")";
return 0;
}
L4-115 太神奇了
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
cout<<b+a-1;
return 0;
}