Advertisement
nontawat1996

Select Party

Jul 3rd, 2011
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.48 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int a[5]={0},i;
  7.     char c;
  8.     while(1)
  9.     {
  10.         printf("Input you Party :\n");
  11.         printf("1: A\n");
  12.         printf("2: B\n");
  13.         printf("3: C\n");
  14.         printf("4: D\n");
  15.         printf("5: E\n");
  16.         printf("Party : ");
  17.         scanf(" %c",&c);
  18.         if(c=='1')
  19.         {
  20.             a[0]++;
  21.             printf("You'll Select Party Again. (Y/N) : ");
  22.             scanf(" %c",&c);
  23.             if(c=='n'||c=='N') break;
  24.         }
  25.         else if(c=='2')
  26.         {
  27.             a[1]++;
  28.             printf("You'll Select Party Again. (Y/N) : ");
  29.             scanf(" %c",&c);
  30.             if(c=='n'||c=='N') break;
  31.         }
  32.         else if(c=='3')
  33.         {
  34.             a[2]++;
  35.             printf("You'll Select Party Again. (Y/N) : ");
  36.             scanf(" %c",&c);
  37.             if(c=='n'||c=='N') break;
  38.         }
  39.         else if(c=='4')
  40.         {
  41.             a[3]++;
  42.             printf("You'll Select Party Again. (Y/N) : ");
  43.             scanf(" %c",&c);
  44.             if(c=='n'||c=='N') break;
  45.         }
  46.         else if(c=='5')
  47.         {
  48.             a[4]++;
  49.             printf("You'll Select Party Again. (Y/N) : ");
  50.             scanf(" %c",&c);
  51.             if(c=='n'||c=='N') break;
  52.         }
  53.         else printf("\nPlease Input Your Party Again.");
  54.         printf("\n");
  55.     }
  56.  
  57.     for(i=0;i<5;i++)
  58.     {
  59.         printf("Party %c Score : %d\n",65+i,a[i]);
  60.     }
  61.     return 0;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement