Compare commits
3 Commits
937af5fba4
...
657ee0dbbf
Author | SHA1 | Date | |
---|---|---|---|
657ee0dbbf | |||
1b88461434 | |||
cb6e3749ee |
9
第一讲 变量、输入输出、表达式与顺序语句/607.cpp
Normal file
9
第一讲 变量、输入输出、表达式与顺序语句/607.cpp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
float a, b, c;
|
||||||
|
scanf("%f%f%f", &a, &b, &c);
|
||||||
|
printf("MEDIA = %.1f\n", (a * 2 + b * 3 + c * 5) / (2 + 3 + 5));
|
||||||
|
return 0;
|
||||||
|
}
|
10
第一讲 变量、输入输出、表达式与顺序语句/610.cpp
Normal file
10
第一讲 变量、输入输出、表达式与顺序语句/610.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
char name[10];
|
||||||
|
double a, b;
|
||||||
|
scanf("%s%lf%lf", &name, &a, &b);
|
||||||
|
printf("TOTAL = R$ %.2lf\n", a + b * 0.15);
|
||||||
|
return 0;
|
||||||
|
}
|
13
第一讲 变量、输入输出、表达式与顺序语句/614.cpp
Normal file
13
第一讲 变量、输入输出、表达式与顺序语句/614.cpp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#include <cmath>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int a, b, c;
|
||||||
|
int max;
|
||||||
|
scanf("%d%d%d", &a, &b, &c);
|
||||||
|
max = (a + b + abs(a - b)) / 2;
|
||||||
|
max = (max + c + abs(max - c)) / 2;
|
||||||
|
printf("%d eh o maior", max);
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user