编写一个程序,输入一个3位正整数,要求反向输出对应的整数,如输入123,则输出321。编出程序并给

2024-12-28 04:22:11
推荐回答(1个)
回答1:

#include 

/*********************************************************
 *                          开 始
 *                            |
 *                      输入三位数a  --------
 *                            |             |
 *                            |             |
 *                            |         反向输出a
 *                            |             |
 *                            |        n    |
 *                      文件输入结束?-------
 *                            |
 *                            |Y
 *                            |
 *                          结 束
 *********************************************************/

int main()
{
    int a;
    while(~scanf ("%d", &a)){
        printf ("%d%d%d\n", a%10, a/10%10, a/100);
    }
    return 0;
}