code.club
標題:
輸入一數字反序列印出來
[打印本頁]
作者:
enter
時間:
2015-8-24 17:07
標題:
輸入一數字反序列印出來
#include <stdio.h>
#include <stdlib.h>
int main(void){
int x;
printf("Enter a number:\n");
scanf("%d",&x);
do{
printf("%d",x%10);
x=x/10;
}while(x!=0);
return 0;
}
歡迎光臨 code.club (https://code.club/)
Powered by Discuz! X3.2