0_0_18470113_22347.cpp:1:9: error: #include expects "FILENAME" or <FILENAME>
#include#include#includeusing%20namespace%20std;int%20main(){ char%20a[250],num[10]; int%20i,j,len,k,temp,t=0; double%20x,y,dis; while(cina) { t++; len=strlen(a); if(a[0]=='E'&&a[1]=='N'&&a[2]=='D')//输入END结束。 break; k=0; x=y=0; for(i=0;i='0'&&a[i]='0') )//对应各自方向进行计算移动后坐标。 y+=temp; else if(a[i-1]=='E'&&( a[i-2]='0') ) x+=temp; else if(a[i-1]=='W'&&( a[i-2]='0') ) x-=temp; else if(a[i-1]=='S'&&( a[i-2]='0') ) y-=temp; else if(a[i-1]=='E'&&a[i-2]=='N' ) { x+=s; y+=s; } else if(a[i-1]=='E'&&a[i-2]=='S' ) { x+=s; y-=s; } else if(a[i-1]=='W'&&a[i-2]=='S' ) { x-=s; y-=s; } else if(a[i-1]=='W'&&a[i-2]=='N' ) { x-=s; y+=s; } k=0; } } dis=sqrt(x*x+y*y);//计算距离。 printf("Map #%d\n",t); printf("The treasure is located at (%.3lf,%.3lf).\n",x,y); printf("The distance to the treasure is %.3lf.\n\n",dis); } return 0;}
^
|