输出
1279: 大声说出我的名字
#include<bits/stdc++.h>
using namespace std;
int main(){
cout <<"My name is Wukong!";
return 0;
}
1280: 让计算机多说几句话
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"My name is Wukong"<<endl;
cout<<"I am nine"<<endl;
cout<<"I like peach"<<endl;
return 0;
}
1282: 金字塔
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<" *"<<endl;
cout<<" ***"<<endl;
cout<<"*****"<<endl;
return 0;
}
1278: 输出字符菱形
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<" *"<<endl;
cout<<" ***"<<endl;
cout<<"*****"<<endl;
cout<<" ***"<<endl;
cout<<" *"<<endl;
return 0;
}
1281: 超级玛丽游戏
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<" ********"<<endl;
cout<<" ************"<<endl;
cout<<" ####....#."<<endl;
cout<<" #..###.....##...."<<endl;
cout<<" ###.......###### ### ###"<<endl;
cout<<" ........... #...# #...#"<<endl;
cout<<" ##*####### #.#.# #.#.#"<<endl;
cout<<" ####*******###### #.#.# #.#.#"<<endl;
cout<<" ...#***.****.*###.... #...# #...#"<<endl;
cout<<" ....**********##..... ### ###"<<endl;
cout<<" ....**** *****...."<<endl;
cout<<" #### ####"<<endl;
cout<<" ###### ######"<<endl;
cout<<"##############################################################"<<endl;
cout<<"#...#......#.##...#......#.##...#......#.##------------------#"<<endl;
cout<<"###########################################------------------#"<<endl;
cout<<"#..#....#....##..#....#....##..#....#....#####################"<<endl;
cout<<"########################################## #----------#"<<endl;
cout<<"#.....#......##.....#......##.....#......# #----------#"<<endl;
cout<<"########################################## #----------#"<<endl;
cout<<"#.#..#....#..##.#..#....#..##.#..#....#..# #----------#"<<endl;
cout<<"########################################## ############"<<endl;
return 0;
}
变量
1293: 记录桃子的个数
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cout<<4<<endl;
return 0;
}
1294: 请吃小龙虾
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
n=8+13;
cout<<n;
return 0;
}
1295: 请吃小龙虾续集
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
n=6;
m=n+5;
cout<<m;
return 0;
}
1283: 计算长方形的周长和面积
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"4"<<endl;
cout<<"3"<<endl;
cout<<"14"<<endl;
cout<<"12"<<endl;
return 0;
}
1296: 子弹的数量
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,s,d,f,g,h;
a=10;
s=50;
d=5;
f=(d+s/a);//算出10秒能发出50颗子弹.
g=60/f;
h=g*50;
cout<<h;
return 0;
}
输出
1284: 苹果采购
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,s;
cin>>a>>s;
cout<<a*s;
return 0;
}
1291: 计算菜地的周长和面积续集
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,s;
cin>>a>>s;
cout<<a<<endl;
cout<<s<<endl;
cout<<a*2+s*2<<endl;
cout<<a*s<<endl;
return 0;
}
1288: 小玉买文具
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,d;
cin>>a>>b;
d=(a*10+b);//单位转换。
cout<<d/(1*10+9)<<endl;
return 0;
}
1292: 计算时间差
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
cout<<(c*60+d)-(a*60+b)<<endl;
return 0;
}
1286: 数字反转
#include<bits/stdc++.h>
using namespace std;
int main(){
double b;
cin>>b;
int a=b*10;
int g=a/1%10;
int s=a/10%10;
int i=a/100%10;
int q=a/1000%10;
cout<<g<<"."<<s<<i<<q;
return 0;
}