讨论 / 怎么错的
zmh 2011-08-02 06:46:00
点我顶贴 收藏 删除
#include "stdio.h"

struct T

{

char c[11];

}a[505];

int main()

{

int n,s=1,p,v=0,w=0,t=1,r=0,e=0;

scanf("%d",&n);

for(int i=0;i<n;i++)

scanf("%s",a[i].c);

for(int i=0;i<n;i++)

{

p=0;

t=1;

e=0;

if(a[i].c[0]=='r')

s+=1;

else if(a[i].c[0]=='l')

s-=1;

else

{

while(a[i].c[p]!='\0')

p++;

for(int k=p-1;k>=0;k--)

{

e+=(a[i].c[k]-'0')*t;

t*=10;

}

r=s+520;

r=r%4;

if(r==0)

v=v-e;

else if(r==1)

w=w+e;

else if(r==2)

v=v+e;

else if(r==3)

w=w-e;

printf("(%d,%d)\n",v,w);

}

}

getchar();

getchar();

return 0;

}

#1 zmh@2010-08-05 20:19:00
回复 删除
测试结果1: 通过本测试点|有效耗时63ms

测试结果2: 通过本测试点|有效耗时47ms

测试结果3: 通过本测试点|有效耗时47ms

测试结果4: 输出过长|用户输出数据超过标准输出两倍[标准输出5位|选手输出225位]

测试结果5: 通过本测试点|有效耗时31ms

测试结果6: 通过本测试点|有效耗时31ms

测试结果7: 通过本测试点|有效耗时47ms

测试结果8: 通过本测试点|有效耗时47ms

测试结果9: 通过本测试点|有效耗时47ms

测试结果10:通过本测试点|有效耗时47ms

#2 XXXlx@2011-08-02 06:46:00
回复 删除
从来不走动,则输出“(0,0)”.

请注意这句话

数据无问题

查看更多回复
提交回复