P1001 A+B Problem
#include <cstdio>
int main()
{
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
return 0;
}
P5703 [深基2.例5] 苹果采购
#include <cstdio>
int main()
{
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", a * b);
return 0;
}
P5704 [深基2.例6] 字母转换
#include <cstdio>
int main()
{
char ch;
scanf("%c", &ch);
printf("%c\n", ch - 'a' + 'A');
return 0;
}
P5705 [深基2.例7] 数字反转
#include <cstdio>
int main()
{
char a, b, c, d, e;
scanf("%c%c%c%c%c", &a, &b, &c, &d, &e);
printf("%c%c%c%c%c\n", e, d, c, b, a);
return 0;
}
P5706 [深基2.例8] 再分肥宅水
#include <cstdio>
int main()
{
double t;
int n;
scanf("%lf%d", &t, &n);
printf("%.3f\n%d\n", t / n, 2 * n);
return 0;
}
P1425 小鱼的游泳时间
#include <cstdio>
int main()
{
int a, b, c, d;
scanf("%d%d%d%d", &a, &b, &c, &d);
int t = c * 60 + d - (a * 60 + b);
printf("%d %d\n", t / 60, t % 60);
return 0;
}
P1421 小玉买文具
#include <cstdio>
int main()
{
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", (a * 10 + b) / 19);
return 0;
}
P3954
#include <cstdio>
int main()
{
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
return 0;
}
标签:main,顺序,return,1.1,int,代码,printf,include,scanf
From: https://www.cnblogs.com/ronchen/p/17574265.html