无语,这种水题还出,浪费时间,但又不得不A。。。

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string.h>
#include <cmath>
#define SICKLE 17
#define KNUT 29
using namespace std;
int a1,a2,a3;
int b1,b2,b3;
int main()
{
scanf("%d.%d.%d %d.%d.%d",&a1,&a2,&a3,&b1,&b2,&b3);
int r1=,r2=,r3=;
r3=a3+b3;
if(r3>=KNUT){
r3-=KNUT;
r2++;
}
r2+=a2+b2;
if(r2>=SICKLE){
r2-=SICKLE;
r1++;
}
r1+=a1+b1;
printf("%d.%d.%d\n",r1,r2,r3);
return ;
}

PAT甲题题解-1058. A+B in Hogwarts (20)-大水题的更多相关文章

  1. PAT 甲级 1058 A+B in Hogwarts (20 分) (简单题)

    1058 A+B in Hogwarts (20 分)   If you are a fan of Harry Potter, you would know the world of magic ha ...

  2. 1058 A+B in Hogwarts (20分)

    1058 A+B in Hogwarts (20分) 题目: If you are a fan of Harry Potter, you would know the world of magic h ...

  3. PAT甲题题解-1012. The Best Rank (25)-排序水题

    排序,水题因为最后如果一个学生最好的排名有一样的,输出的课程有个优先级A>C>M>E那么按这个优先级顺序进行排序每次排序前先求当前课程的排名然后再与目前最好的排名比较.更新 至于查询 ...

  4. PAT甲题题解-1023. Have Fun with Numbers (20)-大数加法

    和1024一样都是大数据的题,因为位数最多要20位,long long最多19位给一个num,求sum=num+num问sum包含的数字,是否是num的一个排列,即数字都一样,只是顺序不同罢了. #i ...

  5. PAT甲题题解-1062. Talent and Virtue (25)-排序水题

    水题,分组排序即可. #include <iostream> #include <cstdio> #include <algorithm> #include < ...

  6. PAT甲题题解-1125. Chain the Ropes (25)-贪心水题

    贪心水题,每次取最短的两个绳子合并,长度缩减成一半 #include <iostream> #include <cstdio> #include <algorithm&g ...

  7. PAT甲题题解-1031. Hello World for U (20)-字符串处理,水

    #include <iostream> #include <cstdio> #include <algorithm> #include <string.h&g ...

  8. PAT甲题题解-1104. Sum of Number Segments (20)-(水题)

    #include <iostream> #include <cstdio> #include <algorithm> #include <string.h&g ...

  9. PAT (Advanced Level) 1058. A+B in Hogwarts (20)

    简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #in ...

随机推荐

  1. python中判断实例可迭代地几种方式

    1. 利用 __iter__内建属性 if hasattr(obj, '__iter__') : print 'iterable' 这种方法不能检测字符串,如:hasattr('', '__iter_ ...

  2. vagrant设置虚拟机的名字

    如果我们不在vagrant init 命令生成的vagrantfile文件中声明虚拟机的名字的话,一般会默认给我们指定一个名字,指定的方法: config.vm.provider "virt ...

  3. MP实战系列(九)之集成Shiro

    下面示例是在之前的基础上进行的,大家如果有什么不明白的可以参考MP实战系列的前八章 当然,同时也可以参考MyBatis Plus官方教程 建议如果参考如下教程,使用的技术为spring+mybatis ...

  4. OpenCV——颜色缩减、计时函数、访问像素

    //颜色空间缩减 //src:源图片 //dst:目标图片 //divideWith:缩减宽度 void ColorSpaceReduction(Mat src,int divideWith,Mat& ...

  5. 学习Kali Linux必须知道的几点

    Kali Linux 在渗透测试和白帽子方面是业界领先的 Linux 发行版.默认情况下,该发行版附带了大量入侵和渗透的工具和软件,并且在全世界都得到了广泛认可.即使在那些甚至可能不知道 Linux ...

  6. Python2.7-stat

    stat模块,用于解释 os.stat(),os.lstat(),os.fstat() 返回的结果,定义了许多表示文件或路径的各个状态的常数和测试各个状态的函数具体参考 官方文档 和 http://w ...

  7. easyui 如何引入

    一:引入easyui 1:参考官网:http://www.jeasyui.net/ 2:引入 整个文件夹:themes,包括:icon.css.image 等等 3:引入easyui.css      ...

  8. lvs 最常用算法 + tcpdump vrrp 抓包

    1.SH: source hash, 源地址散列. 将请求的目标IP地址换成请求的源IP地址:实现session保持的机制:将来自于同一个IP的请求始终调度至同一RS: 源地址散列调度算法正好与目标地 ...

  9. NLB网路负载均衡管理器详解(转载)

    序言 在上一篇配置iis负载均衡中我们使用啦微软的ARR,我在那篇文章也中提到了网站的高可用性,但是ARR只能做请求入口的消息分发服务,这样如果我们的消息分发服务器给down掉啦,那么做再多的应用服务 ...

  10. ubuntu14.04安装jupyter notebook

    1.使用pip安装Jupyter notebook: pip install jupyter notebook 2.创建Jupyter默认配置文件: jupyter notebook --genera ...