2 条题解
-
0
将数据看作字符
#include <stdio.h> 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", e, d, c, b, a); return 0; }
转为整数,利用除和模
#include <stdio.h> int main() { float x; scanf("%f", &x); int n = x * 10; // int x = 123.4 = 123; int a = n / 1000; int b = n / 100 % 10; int c = n / 10 % 10; int d = n % 10; printf("%d.%d%d%d", d, c, b, a); return 0; }
- 1
信息
- ID
- 9
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 4
- 标签
- 递交数
- 144
- 已通过
- 65
- 上传者