code.club

標題: 輸入一正數然後倒序印出來 [打印本頁]

作者: enter    時間: 2015-6-15 00:39
標題: 輸入一正數然後倒序印出來
#include <stdio.h>
#include <stdlib.h>

int main(void){
       
int x;

printf("enter a number bigger tha 0:\n");
scanf("%d",&x);

while(x != 0)
{
        printf("%d",x%10);
        x = x/10;
}
       
        return 0;
}





歡迎光臨 code.club (http://code.club/) Powered by Discuz! X3.2