#include<algorithm>
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int N=202;
char a[N];
int main()
{
int k,x,y;
char ch;
while(scanf("%s",a)!=EOF)
{
k=2;x=310;y=420;
printf("300 420 moveto\n");
printf("310 420 lineto\n");
for(int i=0;i<strlen(a);i++)
{
if(k==1&&a[i]=='A')
{x+=10;k=2;}
else if(k==1&&a[i]=='V')
{x-=10;k=4;}
else if(k==2&&a[i]=='A')
{y-=10;k=3;}
else if(k==2&&a[i]=='V')
{y+=10;k=1;}
else if(k==3&&a[i]=='A')
{x-=10;k=4;}
else if(k==3&&a[i]=='V')
{x+=10;k=2;}
else if(k==4&&a[i]=='A')
{y+=10;k=1;}
else if(k==4&&a[i]=='V')
{y-=10;k=3;}
printf("%d %d lineto\n",x,y);
}
printf("stroke\n");
printf("showpage\n");
}
return 0;
}
hdu1033(水题)
最新推荐文章于 2020-08-03 11:01:48 发布