回覆列表
  • 1 # 程式設計頌

    #include

    #define num 10 //設定你要輸入數字的長度

    void main(void)

    {

    char a[num];

    int i = 0;

    printf("輸入數字:\t");

    gets(a);

    while(a[i] != "\0")

    {

    switch(a[i])

    {

    case "0":printf("零\n");break;

    case "1":printf("一\n");break;

    case "2":printf("二\n");break;

    case "3":printf("三\n");break;

    case "4":printf("四\n");break;

    case "5":printf("五\n");break;

    case "6":printf("六\n");break;

    case "7":printf("七\n");break;

    case "8":printf("八\n");break;

    case "9":printf("九\n");break;

    default:printf("錯誤\n");break;

    }

    i++;

    }

    printf("\n");

    }

  • 中秋節和大豐收的關聯?
  • 新鋪的強化木地板沙沙響是怎麼回事?