zoukankan      html  css  js  c++  java
  • HNU 12827 NASSA’s Robot

    题目链接:http://acm.hnu.cn/online/?action=problem&type=show&id=12827&courseid=268

     1 #include<cstdio>
     2 #include<cstring>
     3 #include<iostream>
     4 #include<algorithm>
     5 using namespace std;
     6 const int maxn = 100000+5;
     7 char str[maxn];
     8 int main()
     9 {
    10     int T;
    11     scanf("%d",&T);
    12     while(T--)
    13     {
    14         scanf("%s",str);
    15         int x1 = 0x7fffffff,y1 = 0x7fffffff,x2 = -0x7fffffff,y2 = -0x7fffffff;
    16         int len = strlen(str),temp[5];
    17         memset(temp,0,sizeof(temp));
    18         for(int i = 0;i < len;++i)
    19         if(str[i] == 'U') temp[0]++;
    20         else if(str[i] == 'R') temp[1]++;
    21         else if(str[i] == 'D') temp[2]++;
    22         else if(str[i] == 'L') temp[3]++;
    23         else temp[4]++;
    24         printf("%d %d %d %d
    ",temp[1]-temp[3]-temp[4],temp[0]-temp[2]-temp[4],temp[1]-temp[3]+temp[4],temp[0]-temp[2] + temp[4]);
    25     }
    26     return 0;
    27 }
    28 
    29 
    30         
    View Code
  • 相关阅读:
    备份
    Ibatis_dataMapper
    查询成绩都大于80分的学生
    删除文件的工具
    从运行中启动收索引擎
    数据库Northwind
    搭建Android开发环境
    数据库知识结构
    数据库MedicineMis_STD
    数据库work
  • 原文地址:https://www.cnblogs.com/xiaxiaosheng/p/3859085.html
Copyright © 2011-2022 走看看