http://acm.hdu.edu.cn/showproblem.php?pid=1033
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<iomanip>
using namespace std;
const int inf=10000000;
int main(){
string s;
while(cin>>s){
int x=300,y=420;
int d=0;///表示移动方向0(右)1(下)2(左)3(上)
printf("%d %d moveto\n",x,y);
x+=10;
printf("%d %d lineto\n",x,y);
for(int i=0;i<s.size();++i){
if(s[i]=='A'){///顺时针转向
if(d==0)y-=10,d=1;
else if(d==1)x-=10,d=2;
else if(d==2)y+=10,d=3;
else x+=10,d=0;
}
else{///逆时针转向
if(d==0)y+=10,d=3;
else if(d==1)x+=10,d=0;
else if(d==2)y-=10,d=1;
else x-=10,d=2;
}
printf("%d %d lineto\n",x,y);
}
puts("stroke");
puts("showpage");
}
return 0;
}