Codeforces Round #426 (Div. 2), problem: (A) The Useless Toy Solution In C/C++

By | 2017-08-04T12:24:29+00:00 August 4th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

#include<bits/stdc++.h> using namespace std; int t[1000]; int main(){ char a,b; int n; scanf(" %c %c",&a,&b); scanf("%d",&n); n%=4; t['^']=0,t['>']=1,t['v']=2,t['<']=3; int c=(t[a]-t[b]+4)%4; if(n==0||n==2)puts("undefined"); else puts(n!=c?"cw":"ccw"); }