-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc.cpp
More file actions
34 lines (29 loc) · 933 Bytes
/
Copy pathc.cpp
File metadata and controls
34 lines (29 loc) · 933 Bytes
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
#include <iostream>
#include <vector>
using namespace std;
int main(){
int deg, dis;
cin >> deg >> dis;
vector<string> dirs = {"N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"};
deg *= 10;
if(dis>14){
int dir_idx = (deg+1125)%36000/2250;
cout << dirs[dir_idx] << " ";
}
else {
cout << "C" << " ";
}
if(dis<=14) cout << 0 << endl;
else if(dis<=92) cout << 1 << endl;
else if(dis<=200) cout << 2 << endl;
else if(dis<=326) cout << 3 << endl;
else if(dis<=476) cout << 4 << endl;
else if(dis<=644) cout << 5 << endl;
else if(dis<=830) cout << 6 << endl;
else if(dis<=1028) cout << 7 << endl;
else if(dis<=1244) cout << 8 << endl;
else if(dis<=1466) cout << 9 << endl;
else if(dis<=1706) cout << 10 << endl;
else if(dis<=1958) cout << 11 << endl;
else cout << 12 << endl;
}