• poj1753


    #include <stdio.h>
    char s[100][100];
    int s1[100][100];
    int ax[5]={0,-1,0,1,0};
    int ay[5]={0,0,-1,0,1};
    int b[100][100]={0};
     
    void main()
    {
        int H,W,N;
        scanf("%d %d %d",&H,&W,&N);
        while((H!=0)&&(W!=0)&&(N!=0))
        {
            for(int i=0;i<H;i++)
            {
                getchar();
                for(int j=0;j<W;j++)
                {
                    scanf("%c",&s[i][j]);
                    if(s[i][j]=='N')
                        s1[i][j]=1;
                    if(s[i][j]=='W')
                        s1[i][j]=2;
                    if(s[i][j]=='S')
                        s1[i][j]=3;
                    if(s[i][j]=='E')
                        s1[i][j]=4;
                }
     
            }
     
            for(int i=0;i<H;i++)
            {
                for(int j=0;j<W;j++)
                    printf("%d",s1[i][j]);
                printf(" ");
            }
            int x=0;
            int y=N-1;
            for(int i=0;i<=10;i++)
            {
                     
                b[x][y]=1;
                printf("%d %d  ",x,y);
                printf("%d  ",s1[x][y]);
                printf("%d %d ",ax[s1[x][y]],ay[s1[x][y]]);
                x+=ax[s1[x][y]];
                y+=ay[s1[x][y]];
                ///*if(x<0||y<0||x==H||y==W)
                //{
                //  printf("%d",i+1);
                //  break;
                //}*/
            }
             
            scanf("%d %d %d",&H,&W,&N);
        }
         
    }
  • 相关阅读:
    编译内核时出现drivers/mfd/mxchdmicore.c:36:24: fatal error: mach/clock.h: No such file or directory
    IE中iframe标签显示在DIV之上的问题解决方案
    Linux驱动学习1.hello world;
    Maven安装与配置(转)
    Jmeter阶梯式压测
    Jmeter的分布式测试
    adb connect命令连接多个Android设备
    Linux当中文件的显示命令
    软件测试流程
    测试时间不够,该怎么办?
  • 原文地址:https://www.cnblogs.com/452035305qq/p/6248645.html
Copyright © 2020-2023  润新知