codeforces 834-A. The Useless Toy

来源:互联网 发布:双子星网上交易软件 编辑:程序博客网 时间:2024/05/21 11:06

点这里

没看见空格。。一直找错。。

水题

#include <iostream>#include <stdio.h>using namespace std;char tt1[5]="v<^>";char tt2[5]="v>^<";char tt3[5];int main(){    while(gets(tt3)!=NULL)    {        int d,f1=0,f2=0;        scanf("%d",&d);        getchar();          d%=4;        for(int i=0; i<4; i++)        {            if(tt3[0]==tt1[i])            {                if(tt1[(i+d)%4]==tt3[2])                    f1=1;                break;            }        }        for(int i=0; i<4; i++)        {            if(tt3[0]==tt2[i])            {                if(tt2[(i+d)%4]==tt3[2])                    f2=1;                break;            }        }         if((f1&&f2)||(!f1&&!f2))                puts("undefined");            else if(f1==1)                puts("cw");            else                puts("ccw");       } return 0;    }