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 zheng at 2006-10-01 13:55:49 on Problem 2556
```#include<stdio.h>
#include<string.h>
void main()
{
char a[201];
while(scanf("%s",a))
{
printf("300 420 moveto\n310 420 lineto\n");
int i,m=310,n=420,flag1=0,flag2=1;//flag1=1 meaning last change is n,or m;
{
if(a[i]=='A')
{
if(flag1==1&&flag2==1)
{
m=m+10;
flag1=0;
//if(n>=420&&m>=300)
printf("%d %d lineto\n",m,n);
continue;
}
else if(flag1==1&&flag2==0)
{
m=m-10;
flag1=0;
//	if(n>=420&&m>=300)
printf("%d %d lineto\n",m,n);
continue;
}
else if(flag2==0)
{
n=n+10;
flag2=1;
flag1=1;
//if(n>=420&&m>=300)
printf("%d %d lineto\n",m,n);
continue;
}
else if(flag2==1)
{
n=n-10;
flag2=0;
flag1=1;
//if(n>=420&&m>=300)
printf("%d %d lineto\n",m,n);
}

}
if(a[i]=='V')
{
if(flag1==1&&flag2==1)
{
m=m-10;
flag1=0;
flag2=0;
//if(m>=300&&n>=420)
printf("%d %d lineto\n",m,n);
continue;
}
else if(flag1==1&&flag2==0)
{
m=m+10;
flag1=0;
//if(m>=300&&n>=420)
printf("%d %d lineto\n",m,n);
continue;
}
else if(flag2==0)
{
n=n-10;
flag1=1;
//if(n>=420&&m>=300)
printf("%d %d lineto\n",m,n);
continue;
}
else if(flag2==1)
{
n=n+10;
flag1=1;
//if(n>=420&&m>=300)
printf("%d %d lineto\n",m,n);
}

}
}
printf("stroke\nshowpage\n");
}
}```

Followed by: