模拟ATM机的错误为什么提示switch expected

//模拟ATM机
#include<stdio.h>
main()
{
    printf("=============================="
              "  |          Please select key:                  |"
              "  |          1.Quary                                    |"
              "  |          2.Credit                                    |"
              "  |          3.Debit                                     |"
              "  |          4.Return                                   |"
             "   ==============================="
              );
    int i,j,k;
    scanf("%d",&i);
    switch(i)
    case 1:
    printf(
   "======================="
" |   your balance is$1000.     |"
" |   Press any key to return...   |"
" |                                                 |"
"   ======================="
);
    case 2:
    printf(
    "========================="
  "  |Please select Credit money:   |"
"   | 1.$50                                       |"
  "  | 2.$100                                       |"
"   | 3.return                                     |"
   " =========================  "
    );
    scanf("%d",&j);
   switch(j)
   {
   case 1:
printf("   your Credit money is $50,thank you !"
       "Press any key to retuen...");break
       case 2:
       printf("   your Credit money is $100,thank you !"
       "Press any key to retuen...");break
       case 3:
       printf("thank you for your using !"
              "good bye");break
   }
   case 3:
   printf("Please select debit money:"
          "1.$50"
          "2.$100"
          "3.$500"
          "4.$1000"
          "5.return"
          );
          scanf("%d",&k);
          switch(k)
          {
              case 1:
              printf("your debit money is $50,thank you"
                     "Press any key to return");break
             case 2:
                printf("your debit money is $100,thank you"
                     "Press any key to return");break
              case 3:
                printf("your debit money is $500,thank you"
                     "Press any key to return");break
                case 4:
                  printf("your debit money is $1000,thank you"
                     "Press any key to return");break
              case 5:
              printf("thank you for your using !"
                     "good bye");break
          }
}

BITEyou
浏览 1624回答 3
3回答

暗域天堂

//模拟ATM机#include<stdio.h>main(){    printf(    "  |===============================================|\n"    "  |          Please select key:                   |\n"    "  |          1. Quary                             |\n"    "  |          2. Credit                            |\n"    "  |          3. Debit                             |\n"    "  |          4. Return                            |\n"    "  |===============================================|\n"    );    int i,j,k;    scanf("%d",&i);    switch(i)    {        case 1:            printf(            "  |===============================================|\n"            "  |        your balance is 1000.                  |\n"            "  |        Press any key to return...             |\n"                      "  |===============================================|\n"            );            break;        case 2:            printf(            "  |===============================================|\n"            "  |        Please select Credit money:            |\n"            "  |          1. 50                                |\n"            "  |          2. 100                               |\n"            "  |          3. return                            |\n"            "  |===============================================|\n"            );            scanf("%d",&j);            switch(j)            {                case 1:                    printf("   your Credit money is $50,thank you !\n"                           "Press any key to retuen...\n");                    break;                case 2:                    printf("   your Credit money is $100,thank you !\n"                          "Press any key to retuen...\n");                    break;                case 3:                   printf("thank you for your using !\n"                          "good bye\n");                   break;            }            break;        case 3:        printf("Please select debit money:\n"                "       1.$50\n"                "       2.$100\n"                "       3.$500\n"                "       4.$1000\n"                "       5.return\n"        );        scanf("%d",&k);        switch(k)        {            case 1:                printf("your debit money is $50,thank you\n"                      "Press any key to return\n");                break;            case 2:               printf("your debit money is $100,thank you\n"                     "Press any key to return\n");               break;            case 3:               printf("your debit money is $500,thank you\n"                     "Press any key to return\n");               break;            case 4:               printf("your debit money is $1000,thank you\n"                     "Press any key to return\n");               break;            case 5:                printf("thank you for your using !\n"                       "good bye\n");                break;        }    }}

暗域天堂

你的代码应该写的规范一点
打开App,查看更多内容
随时随地看视频慕课网APP