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; }
HDU 3400 Line belt 三分,布布扣,bubuko.com
原文地址:http://blog.csdn.net/crescent__moon/article/details/24878117