-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrotateBoard.cpp
More file actions
84 lines (65 loc) · 1.33 KB
/
rotateBoard.cpp
File metadata and controls
84 lines (65 loc) · 1.33 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
84
/*
Author : Asim Krishna Prasad
Aim :
1> To rotate the input board by 90-degrees clockwise
*/
using namespace std;
#include <bits/stdc++.h>
#define wl(n) while(n--)
#define fl(i,a,b) for(i=a; i<b; i++)
#define rev(i,a,b) for(i=a; i>=b; i--)
#define si(n) scanf("%d", &n)
#define sll(l) scanf("%lld",&l)
#define ss(s) scanf("%s", s)
#define sc(c) scanf("%c", &c)
#define sd(f) scanf("%lf", &f)
#define pi(n) printf("%d\n", n)
#define pll(l) printf("%lld\n", l)
#define ps(s) printf("%s\n", s)
#define pc(c) printf("%c\n", c)
#define pd(f) printf("%lf\n", f)
#define debug(x) cout<<"\n#("<<x<<")#\n"
#define nline printf("\n")
#define mem(a,i) memset(a,i,sizeof(a))
#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int
#define mclr(strn) strn.clear()
#define ignr cin.ignore()
#define PB push_back
#define SZ size
#define MP make_pair
#define fi first
#define sec second
const int LIMIT = 8;
vector<string> playerMatrix, rotatedBoard;
char pieceLifted;
int main()
{
int i, j, l;
freopen("thisPlayerMatrix", "r", stdin);
fl(i,0,LIMIT)
{
string temp;
cin>>temp;
playerMatrix.PB(temp);
}
fl(i,0,LIMIT)
{
string temp = "";
fl(j,0,LIMIT)
{
temp += playerMatrix[j][i];
}
rotatedBoard.PB(temp);
}
fl(i,0,LIMIT)
{
fl(j,0,LIMIT)
{
cout<<rotatedBoard[i][j];
}
nline;
}
return 0;
}