Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
97892 | 吴梓玄 | 04倒序输出五位数 | C | Compile Error | 0 MS | 0 KB | 224 | 2024-11-16 17:30:15 |
#include <stdio.h> int main() { double a, b, c, d, e, f, s; scanf("%d",&a); b=a/10000; c=(a/1000)%10; d=(a/100)%10; e=(a/10)%10; f=a%10; s=f*10000+e*1000+d*100+c*10+b; printf("%d\n",s); return 0; }
Main.c: In function 'main': Main.c:5:8: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'double *' [-Wformat=] scanf("%d",&a); ^ Main.c:7:12: error: invalid operands to binary % (have 'double' and 'int') c=(a/1000)%10; ^ Main.c:8:11: error: invalid operands to binary % (have 'double' and 'int') d=(a/100)%10; ^ Main.c:9:10: error: invalid operands to binary % (have 'double' and 'int') e=(a/10)%10; ^ Main.c:10:5: error: invalid operands to binary % (have 'double' and 'int') f=a%10; ^ Main.c:12:9: warning: format '%d' expects argument of type 'int', but argument 2 has type 'double' [-Wformat=] printf("%d\n",s); ^ Main.c:5:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&a); ^