【入门1】顺序结构-创新互联
目录https://www.luogu.com.cn/training/100#problems
创新互联建站主营榆中网站建设的网络公司,主营网站建设方案,成都APP应用开发,榆中h5成都微信小程序搭建,榆中网站营销推广欢迎榆中等地区企业咨询
- B2002 Hello,World!
- B2025 输出字符菱形
- P1000 超级玛丽游戏
- P1001 A+B Problem
- B2005 字符三角形
- P5703 【深基2.例5】苹果采购
- P5704 【深基2.例6】字母转换
- P5705 【深基2.例7】数字反转
- P5706 【深基2.例8】再分肥宅水
- P5708 【深基2.习2】三角形面积
- P5707 【深基2.例12】上学迟到
- B2029 大象喝水
- P1425 小鱼的游泳时间
- P1421 小玉买文具
- P3954 [NOIP2017 普及组] 成绩
#includeusing namespace std;
int main(void)
{printf("Hello,World!");
return 0;
}
B2025 输出字符菱形#includeusing namespace std;
int main(void)
{for(int i=1;i<=3;i++)
{for(int j=1;j<=3-i;j++)
cout<<" ";
for(int j=1;j<=i*2-1;j++)
cout<<"*";
puts("");
}
for(int i=2;i>=1;i--)
{for(int j=1;j<=2-i+1;j++) cout<<" ";
for(int j=1;j<=i*2-1;j++)
cout<<"*";
puts("");
}
return 0;
}
P1000 超级玛丽游戏#includeint main() {printf(
" ********\n"
" ************\n"
" ####....#.\n"
" #..###.....##....\n"
" ###.......###### ### ###\n"
" ........... #...# #...#\n"
" ##*####### #.#.# #.#.#\n"
" ####*******###### #.#.# #.#.#\n"
" ...#***.****.*###.... #...# #...#\n"
" ....**********##..... ### ###\n"
" ....**** *****....\n"
" #### ####\n"
" ###### ######\n"
"##############################################################\n"
"#...#......#.##...#......#.##...#......#.##------------------#\n"
"###########################################------------------#\n"
"#..#....#....##..#....#....##..#....#....#####################\n"
"########################################## #----------#\n"
"#.....#......##.....#......##.....#......# #----------#\n"
"########################################## #----------#\n"
"#.#..#....#..##.#..#....#..##.#..#....#..# #----------#\n"
"########################################## ############\n"
);
return 0;
}
P1001 A+B Problem#includeint main(void)
{int a,b;
scanf("%d %d",&a,&b);
printf("%d",a+b);
return 0;
}
B2005 字符三角形#includeusing namespace std;
int main(void)
{string c; cin>>c;
for(int i=1;i<=3;i++)
{for(int j=1;j<=3-i;j++) cout<<" ";
for(int j=1;j<=i*2-1;j++) cout<
P5703 【深基2.例5】苹果采购#includeint main(void)
{unsigned long a,b;
scanf("%lu %lu",&a,&b);
printf("%lu",a*b);
return 0;
}
P5704 【深基2.例6】字母转换#includeint main(void)
{char a;
a=getchar();
printf("%c\n",a-32);
return 0;
}
P5705 【深基2.例7】数字反转#includeusing namespace std;
int main(void)
{string s; cin>>s;
reverse(s.begin(),s.end());
cout<
P5706 【深基2.例8】再分肥宅水#includeint main(void)
{double V;
int n;
scanf("%lf %d",&V,&n);
printf("%.3lf\n%d",V/n,n*2);
return 0;
}
P5708 【深基2.习2】三角形面积#include#includeint main(void)
{double a,b,c;
double sum;
scanf("%lf %lf %lf",&a,&b,&c);
sum=(a+b+c)/2.0;
sum=sum*(sum-a)*(sum-b)*(sum-c);
printf("%.1lf",sqrt(sum));
return 0;
}
P5707 【深基2.例12】上学迟到#include#include#includeusing namespace std;
int a1=8*60;
int a2=24*60;
int main(void)
{int s,v; cin>>s>>v;
int t;
if(s%v==0) t=s/v;
else t=s/v+1;
int temp=a1-t-10;
if(temp>=0)
{printf("%02d:%02d\n",temp/60,temp%60);
}
else
{temp=a2+temp;
printf("%02d:%02d\n",temp/60,temp%60);
}
return 0;
}
B2029 大象喝水#includeusing namespace std;
#define pi 3.1415926
int main(void)
{double h,r; cin>>h>>r;
int ans=ceil(20*1000/(h*pi*r*r));
cout<
P1425 小鱼的游泳时间#include#includeusing namespace std;
int main(void)
{int a,b,c,d; cin>>a>>b>>c>>d;
int sum1=a*60+b;
int sum2=c*60+d;
printf("%d %d\n",(sum2-sum1)/60,(sum2-sum1)%60);
return 0;
}
P1421 小玉买文具#include#includeusing namespace std;
int main(void)
{int a=19;
int s1,s2; cin>>s1>>s2;
cout<<(s1*10+s2)/a<
P3954 [NOIP2017 普及组] 成绩#includeint main(void)
{int A, B,C;
int sum=0;
scanf("%d %d %d",&A,&B,&C);
sum=A*0.2+B*0.3+C*0.5;
printf("%d",sum);
return 0;
}
你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧
当前文章:【入门1】顺序结构-创新互联
转载来于:http://lswzjz.com/article/coppgg.html