UVA12503-Robot Instructions
来源:互联网 发布:stp什么软件打开 编辑:程序博客网 时间:2024/06/01 08:46
#include <stdio.h>#include <string.h>int main(){ char s[111][111],ss[11]; int T,n,xx,i; scanf("%d",&T); while(T--) { scanf("%d",&n);getchar();//注意 int x=0; for(i=1; i<=n; i++) { scanf("%s",s[i]);//提交时此题若用gets()读入字符串会出错 if(strcmp(s[i],"LEFT")==0) { x--; } else if(strcmp(s[i],"RIGHT")==0) { x++; } else { scanf("%s",ss); scanf("%d",&xx); strcpy(s[i],s[xx]); if(strcmp(s[i],"LEFT")==0) { x--; } else if(strcmp(s[i],"RIGHT")==0) { x++; } } } printf("%d\n",x); } return 0;}
阅读全文
0 0
- UVA12503-Robot Instructions
- Robot Instructions
- Robot Instructions
- 12503 - Robot Instructions
- UVA 12503 - Robot Instructions
- UVa 12503 - Robot Instructions
- Robot Instructions UVA
- Robot
- robot
- robot
- Robot
- Robot
- 8086 instructions
- MMX Instructions
- SSE Instructions
- ARM Instructions
- jmp instructions
- ARM Instructions
- Map转json遇到一些问题
- 关于HTTP协议的研究
- 解决xx is not in the sudoers file. This incident will be reported.问题
- jquery dataTable 隐藏某列
- git 远程版本库,github提供服务原理,git自动更新发送邮件
- UVA12503-Robot Instructions
- Q106:Mac系统下安装编译PBRT-V3
- SQL SERVER 注册服务器使用
- android探索之路:截取字符串substring()的用法
- Web系统大规模并发——电商秒杀与抢购
- 机房收费系统之六(上下机窗体)
- 库函数(过程)调用和系统调用的区别
- PHP中把stdClass Object转array的几个方法
- PHP面向对象3-引用&