Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## 牛人们,帮忙看个程序吧...

Posted by jiabiao at 2005-08-28 21:09:29 on Problem 2556
```#include<stdio.h>
void main()
{
char str[200];
int i,m=310,n=420,x,y;
while(scanf("%s",str)!=EOF)
{
printf("300 420 moveto\n");
printf("310 420 lineto\n");
m=310;n=420;
for(i=0;str[i];i++)
{
if(str[i]=='V')
{
if((m+n)%20==0)
{
if(n>420)
{
x=m-10;y=n;
printf("%d %d lineto\n",x,n);
}
if(n<420)
{
x=m+10;y=n;
printf("%d %d lineto\n",x,n);
}
}
if((m+n)%20!=0)
{
y=n+10;x=m;
printf("%d %d lineto\n",m,y);
}
m=x;n=y;
}
if(str[i]=='A')
{
if((m+n)%20==0)
{
if(n>420)
{
x=m+10;y=n;
printf("%d %d lineto\n",x,n);
}
if(n<420)
{
x=m-10;y=n;
printf("%d %d lineto\n",x,n);
}
}
if((m+n)%20!=0)
{
y=n-10;x=m;
printf("%d %d lineto\n",m,y);
}
m=x;n=y;
}
}
printf("stroke\n");
printf("showpage\n");
}
}```

Followed by: