2011年4月24日 星期日

分享

高中生程式解題系統 a038: 數字翻轉


#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>

int main(void) 
{
    
    int input;
    int output;

    while(scanf("%d",&input)!=EOF)
    {
        output = 0;

        while(input)
        {
            output *= 10;
            output += input % 10;
            input /= 10;
        }
        printf("%d\n",output);

    }
    
    return 0;
}

沒有留言:

張貼留言