1
0
mirror of https://github.com/renbaoshuo/202401-programming-assignments.git synced 2024-11-23 09:38:42 +00:00

【实践课内】1.顺序结构

This commit is contained in:
Baoshuo Ren 2024-10-16 11:19:34 +08:00 committed by GitHub
parent 1e0c23a743
commit b408afeedd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 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;
}

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

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

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