提交时间:2022-07-10 19:09:09
运行 ID: 29066
#include <iostream> using namespace std; class compare { public: int turn(char a) { switch(a) { case 118: return 0; case 60: return 1; case 94: return 2; case 62: return 3; } } int operator()(char a, char b) { int result = turn(a) - turn(b); result = result < 0 ? result + 4 : result; return result; } }; int main() { char a, b; cin >> a >> b; int time; cin >> time; time %= 4; compare c; if(c(a, b) == c(b, a)) { cout << "undefined" << endl; } else if(c(a, b) == time) { cout << "ccw" << endl; } else { cout << "cw" << endl; } return 0; }