1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 21:58:41 +00:00

Compare commits

..

2 Commits

Author SHA1 Message Date
62aa46db3b
【实践课内】1.顺序结构 2024-10-16 11:23:59 +08:00
b408afeedd
【实践课内】1.顺序结构 2024-10-16 11:19:34 +08:00
8 changed files with 51 additions and 0 deletions

View 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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 KiB

View 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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 KiB

View 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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 KiB

View 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;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 KiB