-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplan2.cpp
More file actions
83 lines (78 loc) · 1.73 KB
/
plan2.cpp
File metadata and controls
83 lines (78 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include<stdio.h>
#include<string.h>
void table2(int n){
int i=0,j=0;
int counter=0;
int x=0,y=0;
char teamTable[32][15]={" Argentina "," Australia "," Belgium "," Brazil "," Colombia "," Costa Rica "," Croatia "," Denmark "," Egypt "," England "," France "," Germany "," Iceland "," Iran "," Japan "," Korea "," Mexico "," Morocco "," Nigeria "," Panama "," Peru "," Poland "," Portugal "," Russia "," Saudi Arabia "," Senegal "," Serbia "," Spain "," Sweden "," Switzerland "," Tunisia "," Uruguay "};
char teamBoard[32][5][15];
for(i = 0;i<32;i++){
for(j=0;j<5;j++){
strcpy(teamBoard[i][j],"0");
}
}
for(j=0;j<n;j++)
{
if(j==0)
{
for(i=0;i<32;i+=2)
{
strcpy(teamBoard[i][j],teamTable[(p->number)-1]);
}
}
if(j==1)
{
for(i=1;i<32;i+=4)
{
strcpy(teamBoard[i][j],teamTable[(p->number)-1]);
}
}
if(j==2)
{
for(i=3;i<32;i+=8)
{
strcpy(teamBoard[i][j],teamTable[(p->number)-1]);
}
}
if(j==3)
{
for(i=7;i<32;i+=16)
{
strcpy(teamBoard[i][j],teamTable[(p->number)-1]);
}
}
if(j==4)
{
for(i=15;i<32;i+=17)
{
strcpy(teamBoard[i][j],teamTable[(p->number)-1]);
}
}
}
for(i =0;i<32;i++)
{
// printf("\n");
for(j=0;j<5;j++)
{
if(strcmp(teamBoard[i][j],"0")!=0)
{
printf("|");
printf("%s",teamBoard[i][j]);
printf("|");
}
if(strcmp(teamBoard[i][j],"0")==0)
{
printf(" ");
}
}
printf("\n");
}
//
strcpy(teamBoard[i][j],teamTable[(p->number)-1]);
printf("|");
printf("%s",teamBoard[i][j]);
printf("|");
}
int main(){
table2(5);
}