mirror of
https://github.com/renbaoshuo/202401-programming-assignments.git
synced 2024-11-23 15:48:42 +00:00
Compare commits
2 Commits
1e0c23a743
...
62aa46db3b
Author | SHA1 | Date | |
---|---|---|---|
62aa46db3b | |||
b408afeedd |
11
【实践课内】1.顺序结构/7-1 计算摄氏温度.c
Normal file
11
【实践课内】1.顺序结构/7-1 计算摄氏温度.c
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int f;
|
||||||
|
|
||||||
|
scanf("%d", &f);
|
||||||
|
|
||||||
|
printf("Celsius = %d\n", 5 * (f - 32) / 9);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
【实践课内】1.顺序结构/7-1 计算摄氏温度.jpg
Normal file
BIN
【实践课内】1.顺序结构/7-1 计算摄氏温度.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 259 KiB |
18
【实践课内】1.顺序结构/7-2 逆序的三位数.c
Normal file
18
【实践课内】1.顺序结构/7-2 逆序的三位数.c
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int x;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
scanf("%d", &x);
|
||||||
|
|
||||||
|
int res = 0;
|
||||||
|
|
||||||
|
while (x) {
|
||||||
|
res = (res * 10) + (x % 10);
|
||||||
|
x /= 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%d\n", res);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
【实践课内】1.顺序结构/7-2 逆序的三位数.jpg
Normal file
BIN
【实践课内】1.顺序结构/7-2 逆序的三位数.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 269 KiB |
11
【实践课内】1.顺序结构/7-3 日期格式化.c
Normal file
11
【实践课内】1.顺序结构/7-3 日期格式化.c
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int y, m, d;
|
||||||
|
|
||||||
|
scanf("%2d-%2d-%4d", &m, &d, &y);
|
||||||
|
|
||||||
|
printf("%04d-%02d-%02d\n", y, m, d);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
【实践课内】1.顺序结构/7-3 日期格式化.jpg
Normal file
BIN
【实践课内】1.顺序结构/7-3 日期格式化.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 303 KiB |
11
【实践课内】1.顺序结构/7-4 21-爬楼梯.c
Normal file
11
【实践课内】1.顺序结构/7-4 21-爬楼梯.c
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int a, t, b;
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
scanf("%d%d%d", &a, &t, &b);
|
||||||
|
|
||||||
|
printf("%d", 1ll * t * (b - 1) / (a - 1));
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
【实践课内】1.顺序结构/7-4 21-爬楼梯.jpg
Normal file
BIN
【实践课内】1.顺序结构/7-4 21-爬楼梯.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 296 KiB |
Loading…
Reference in New Issue
Block a user