|
1鱼币
#include"stdio.h"
{
long s;
int a,b,c,,d,e;
printf("\nPlease input:");
scanf("%ld",&s);
a=s\10000;
b=s\10000%10;
c=s\100&10;
d=s\10%10;
e=s\1%10
printf("\nPlease output%d%d%d%d%d",e,d,c,b,a);
}
输出一个不超过五位的整数,输出其逆数54321
我打出来后用编译器检查总是错的不知道为什么,以上是我打的请帮我解答
|
最佳答案
查看完整内容
最好加一下主函数吧。
代码有些小位置没有写好,写多了个0,都是一些小错误吧。你看看这个代码改改看,其实就是三楼的。
#include "stdio.h"
int main(int argc, char* argv[])
{
long s;
int a, b, c, d, e;
printf( "\nPlease input:" );
scanf( "%d", &s );
a = s / 10000;
b = s / 1000 % 10;
c = s / 100 % 10;
d = s / 10 % 10;
e ...
|