Air,Bawang,Campur Coding
#include
int main()
{
int p;
int c;
int g;
label:
printf("\n");
printf("Selamat datang ke permainan Air,Bawang,Campur\n");
printf("Selamat Mencuba\n");
printf("Sila buat Pilihan:\n");
printf("(1) <>\n");
printf("(2) <>\n");
printf("(3) <>\n");
printf("pilihan Player 1=====> \n");
scanf("%d",&p); switch (p) while (p<0>3)
{
case 1: printf("<>\n");break;
case 2: printf("<>\n");break;
case 3: printf("<>\n");break;
}
printf("\n"); printf("pilihan Player 2\n");
printf("(1) <>\n");
printf("(2) <>\n");
printf("(3) <>\n");
printf("pilihan Player 2=====> \n");
scanf("%d",&c);
switch (c) while (c<0>3)
{
case 1: printf("<>\n");break;
case 2: printf("<>\n");break;
case 3: printf("<>\n");break;
}
printf("\n");
printf("pilihan Player 3\n");
printf("(1) <>\n");
printf("(2) <>\n");
printf("(3) <>\n");
printf("pilihan Player 3=====> \n");
scanf("%d",&g);
switch (g) while (g<0>3)
{
case 1: printf("<>\n");break;
case 2: printf("<>\n");break;
case 3: printf("<>\n");break;
}
if (p==c||p==g||g==c)
printf("Anda Seri\n\a");
else if (((p==1)&&(c==2)&&(g==3))||((p==2)&&(c==1)&&(g==3)))
printf(">>>>>>>>Player 3 Menang<<<<<<<<\n\a");
else if (((p==1)&&(c==3)&&(g==2))||((p==2)&&(c==3)&&(g==1)))
printf(">>>>>>>>Player 2 Menang<<<<<<<<\n\a");
else if (((p==3)&&(c==1)&&(g==2))||((p==3)&&(c==2)&&(g==1)))
printf(">>>>>>>>Player 1 Menang<<<<<<<<\n\a");
goto label;
}

Comments

Popular posts from this blog

List Of MSI Motherboard with type of Processor Slot

How to resize and extend centos 7 disk manually