this programming still not perfect....

i'm actually want to create football fixtures anduser can input how many team will play...then..they can see the table...

follow the ranking based on their point...

(it need to input all score every match so you can see the proper table if not some weird number appear)

Code:#include<stdio.h> #include<string.h> #include<windows.h> int main() { int option,y,score,goalA,goalB,goalC,goalD,x,W1,W2,W3,W4,W5,W6,L1,L2,L3,L4,L5,L6,D1,D2,D3,D4,D5,D6; char teamA[100], teamB[100],teamC[100],teamD[100]; int TeamAWin (int, int, int); int TeamALose(int, int, int); int TeamADraw(int, int, int); int TeamBWin (int, int, int); int TeamBLose(int, int, int); int TeamBDraw(int, int, int); int TeamCWin (int, int, int); int TeamCLose(int, int, int); int TeamCDraw(int, int, int); int TeamDWin (int, int, int); int TeamDLose(int, int, int); int TeamDDraw(int, int, int); for(y=0;y<1000;y++) { printf("Enter '1' to see the fixtures\nEnter '2' to see the table\nEnter '3' to create league\nEnter '4' to end\n"); scanf("%d",&option); system("cls"); switch(option) { case 1: printf("1 = %s vs %s\n",teamA,teamC); printf("2 = %s vs %s\n",teamB,teamD); printf("3 = %s vs %s\n",teamA,teamB); printf("4 = %s vs %s\n",teamC,teamD); printf("5 = %s vs %s\n",teamA,teamD); printf("6 = %s vs %s\n\n",teamC,teamB); for(x=0;x<1000;x++) { printf("\n\nEnter number match to input the score\nenter '7' to go main menu\n"); scanf("%d",&score); switch(score) { case 1: printf("%s vs %s\n",teamA,teamC); scanf("%d %d",&goalA,&goalC); fflush(stdin); if(goalA>goalC) { W1=1; L1=0; D1=0; } else if(goalA<goalC) { L1=1; W1=0; D1=0; } else if(goalA==goalC) { D1=1; W1=0; L1=0; } break; case 2: printf("%s vs %s\n",teamB,teamD); scanf("%d %d",&goalB,&goalD); fflush(stdin); if(goalB>goalD) { W2=1; L2=0; D2=0; } else if(goalB<goalD) { L2=1; W2=0; D2=0; } else if(goalB==goalD) { D2=1; W2=0; L2=0; } break; case 3: printf("%s vs %s\n",teamA,teamB); scanf("%d %d",&goalA,&goalB); fflush(stdin); if(goalA>goalB) { W3=1; L3=0; D3=0; } else if(goalA<goalB) { L3=1; W3=0; D3=0; } else if(goalA==goalB) { D3=1; W3=0; L3=0; } break; case 4: printf("%s vs %s\n",teamC,teamD); scanf("%d %d",&goalC,&goalD); fflush(stdin); if(goalC>goalD) { W4=1; L4=0; D4=0; } else if(goalA<goalC) { L4=1; W4=0; D4=0; } else if(goalA==goalC) { D4=1; W4=0; L4=0; } break; case 5: printf("%s vs %s\n",teamA,teamD); scanf("%d %d",&goalA,&goalD); fflush(stdin); if(goalA>goalD) { W5=1; L5=0; D5=0; } else if(goalA<goalD) { L5=1; W5=0; D5=0; } else if(goalA==goalD) { D5=1; W5=0; L5=0; } break; case 6: printf("%s vs %s\n",teamC,teamB); scanf("%d %d",&goalC,&goalB); fflush(stdin); if(goalC>goalB) { W6=1; L6=0; D6=0; } else if(goalC<goalB) { L6=1; W6=0; D6=0; } else if(goalC==goalB) { D6=1; W6=0; L6=0; } break; case 7: system("cls"); break; default: puts("\nwrong input"); } if(score==7) break; } break; case 2: fflush(stdin); printf("Team \twin\tlose\tdraw\tgoal\tconceded\n"); printf("TeamA\t%5d\t%d\t%d\t%d\t%d\n",TeamAWin(W1, W3, W5), TeamALose(L1, L3, L5), TeamADraw(D1, D3, D5)); printf("TeamB\t%5d\t%d\t%d\t%d\t%d\n",TeamBWin(W2, W3, W6), TeamBLose(L2, L3, L6), TeamBDraw(D2, D3, D6)); printf("TeamC\t%5d\t%d\t%d\t%d\t%d\n",TeamCWin(W1, W4, W6), TeamCLose(L1, L4, L6), TeamCDraw(D1, D4, D6)); printf("TeamD\t%5d\t%d\t%d\t%d\t%d\n",TeamDWin(W2, W4, W5), TeamDLose(L2, L4, L5), TeamCDraw(D1, D4, D6)); break; case 3: fflush(stdin); printf("input 4 name team:\n"); gets(teamA); fflush(stdin); gets(teamB); fflush(stdin); gets(teamC); fflush(stdin); gets(teamD); fflush(stdin); system("cls"); break; case 4: break; default: puts("wrong input\n\n"); } if(option==4) break; } return 0; } int TeamAWin(int W1,int W3,int W5) { int Win; Win = W1 + W3 + W5; return Win; } int TeamALose(int L1,int L3,int L5) { int Lose; Lose = L1 + L3 + L5; return Lose; } int TeamADraw(int D1,int D3,int D5) { int Draw; Draw = D1 + D3 + D5; return Draw; } int TeamBWin(int W2,int W3,int W6) { int Win; Win = W2 + W3 + W6; return Win; } int TeamBLose(int L2,int L3,int L6) { int Lose; Lose = L2 + L3 + L6; return Lose; } int TeamBDraw(int D2,int D3,int D6) { int Draw; Draw = D2 + D3 + D6; return Draw; } int TeamCWin(int W1,int W4,int W6) { int Win; Win = W1 + W4 + W6; return Win; } int TeamCLose(int L1,int L4,int L6) { int Lose; Lose = L1 + L4 + L6; return Lose; } int TeamCDraw(int D1,int D4,int D6) { int Draw; Draw = D1 + D4 + D6; return Draw; } int TeamDWin(int W2,int W4,int W5) { int Win; Win = W2 + W4 + W5; return Win; } int TeamDLose(int L2,int L4,int L5) { int Lose; Lose = L2 + L4 + L5; return Lose; } int TeamDDraw(int D1,int D3,int D5) { int Draw; Draw = D1 + D3 + D5; return Draw; }