East 1 0 North 1 1
North East
AC码:
#include<stdio.h> int main() { int n,i,t,a; char str[8],ch[4][8]={"East","South","West","North"}; while(~scanf("%s%d",str,&n)) { for(i=0;i<4;i++) { if(str[0]==ch[i][0]) { t=i; break; } } for(i=1;i<=n;i++) { scanf("%d",&a); if(a==1) t=(t+5)%4; else t=(t+3)%4; } printf("%s\n",ch[t]); } return 0; }
NYOJ 624 笨蛋的难题(一),布布扣,bubuko.com
原文地址:http://blog.csdn.net/u012804490/article/details/24878353