您的位置:首页 > 编程语言 > C语言/C++

C语言实验——逆置正整数

2017-12-28 19:57 751 查看


C语言实验——逆置正整数

Time Limit: 1000MS Memory Limit: 65536KB

Submit Statistic


Problem Description

输入一个三位正整数,将它反向输出。


Input

3位正整数。


Output

逆置后的正整数。


Example Input

123



Example Output

321



Hint

注意130逆置后是31


Author

crq

#include <stdio.h>

int main()

{

    int x,a,b,c;

4000

    scanf("%d",&x);

    c=x%10;

    b=(x/10)%10;

    a=x/100;

    printf("%d\n",c*100+b*10+a);

    return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: