/*給乙個不多於5位的正整數要求:(1)求出它是幾位數(2)分別輸出每一位數字(3)按逆序輸出各位數字,123→321*/#include"stdio.h"main() 若原數為123 錯拉 顯示到過來的數為32100 */
/*(3)*/
switch(place)
case 5:printf("dao guo lai de shu wei:");
printf("%d%d%d%d%d",e,d,c,b,a);
break;
case 4:printf("dao guo lai de shu wei:");
printf("%d%d%d%d",d,c,b,a);
break;
case 3:printf("dao guo lai de shu wei:");
printf("%d%d%d",c,b,a);
break;
case 2:printf("dao guo lai de shu wei:");
printf("%d%d",b,a);
break;
case 1:printf("dao guo lai de shu wei:");
printf("%d",a);
當你輸入12345時沒錯 但是你輸入123 會顯示100 輸入1234 應該會顯示3210
還有乙個問題就是第2問輸入 123 會顯示 00123 而不是123
我知道有點麻煩 大哥們拜託拉
展開
c語言怎麼把數字倒過來 c語言程式設計 實現數字的翻轉
方法一 易理解的 include include int main int n scanf d n 輸入要翻轉的數字 int result 0 儲存翻轉後的結果 while 1 while true 也可以 int i n 10 每次都是得到最低位上的數字 result result 10 i n ...
c語言怎麼將ascii碼改為數字 C語言培訓手冊
編譯器要處理資料 那麼就需要知道資料的儲存大小和儲存方式 即資料型別 雖然c語言的資料型別較多,但常用的四種基本資料型別 為char int float double,以下進行介紹 整數 int存放整數一般為4位元組 可正可負 int型別允許儲存的位元組數是4個位元組,換算出int unsigned...
C語言中的 ,
c語言中的 今天在分析乙份原始碼的時候遇到了如下 define uf call x report file line x,x static int report char file,int line,char call,int irc return irc 網上參考 cpp view plain c...