PAT甲题题解-1058. A+B in Hogwarts (20)-大水题
无语,这种水题还出,浪费时间,但又不得不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)-大水题的更多相关文章
- 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 ...
- 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 ...
- PAT甲题题解-1012. The Best Rank (25)-排序水题
排序,水题因为最后如果一个学生最好的排名有一样的,输出的课程有个优先级A>C>M>E那么按这个优先级顺序进行排序每次排序前先求当前课程的排名然后再与目前最好的排名比较.更新 至于查询 ...
- PAT甲题题解-1023. Have Fun with Numbers (20)-大数加法
和1024一样都是大数据的题,因为位数最多要20位,long long最多19位给一个num,求sum=num+num问sum包含的数字,是否是num的一个排列,即数字都一样,只是顺序不同罢了. #i ...
- PAT甲题题解-1062. Talent and Virtue (25)-排序水题
水题,分组排序即可. #include <iostream> #include <cstdio> #include <algorithm> #include < ...
- PAT甲题题解-1125. Chain the Ropes (25)-贪心水题
贪心水题,每次取最短的两个绳子合并,长度缩减成一半 #include <iostream> #include <cstdio> #include <algorithm&g ...
- PAT甲题题解-1031. Hello World for U (20)-字符串处理,水
#include <iostream> #include <cstdio> #include <algorithm> #include <string.h&g ...
- PAT甲题题解-1104. Sum of Number Segments (20)-(水题)
#include <iostream> #include <cstdio> #include <algorithm> #include <string.h&g ...
- PAT (Advanced Level) 1058. A+B in Hogwarts (20)
简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #in ...
随机推荐
- Windows10下python3.5的sklearn库安装
具体安装方法参考https://blog.csdn.net/HYDMonster/article/details/79766086 但是注意的是,http://www.lfd.uci.edu/~goh ...
- 移动web前端开发时注意事项
在智能手机横行的时代,作为一个web前端,不会编写移动web界面,的确是件悲催的事情.当公司准备做一个微信的微网站时,作为一个多年经验的web前端码农,我迷茫了,真心不知道从何下手. 接下来就是搜一堆 ...
- ArcMap 导入Excel坐标数据
1 准备Excel坐标数据集合 2 ArcMap加入Excel数据 将excel文件放入arcmap工作区的物理路径下 在工作区的根图层上点键,选择添加数据,找到excel文件并选择相应的工作薄 ...
- python第三十六课——2.迭代器对象
满足前提: 1).必须是一个可迭代对象 2).可以被next()所作用的 举例: generator... 高效的检测一个对象是否是迭代器对象 需要使用collections模块中的Iterator类 ...
- 怎样自适应ios设备大小
在编写移动端GIS程序的时候.常常要依据ios设备的大小来设置UI.曾经我在ios程序中,须要定义设备的值(如:宽度和高度),如: 可是假设是不同的设备.如iphone4.iphone5,甚至是 ...
- uniform_tree以及其变体
//判断一棵树是不是uniform-tree bool uniform_tree(TreeNode* root){ if(root == NULL) return true; return unifo ...
- Linux安装配置apache
Linux安装配置apache 1.获取软件: http://httpd.apache.org/ httpd-2.2.21.tar.gz 2.安装步骤: 解压源文件: 1 tar zvxf ht ...
- 微信小程序开发 [02] 页面注册和基本组件
1.页面注册 既然我们希望跳转到新的页面,那自然要新建页面相关的文件才行.在开篇已经讲过,一个小程序页面由四个文件组成,假如我们的页面名为welcome,那么这四个文件则是: welcome.js w ...
- LCD驱动应该怎么写?–基于stm32F407 [复制链接]
够用的硬件能用的代码使用的教程 (拷贝过来的代码有点乱,请下载附件查看文档) 资料下载地址:https://pan.baidu.com/s/1bHUVe6X6tymktUHk_z91cA 网络上配套S ...
- 50Hz工频干扰消除
50Hz工频干扰消除 今天整理工频干扰消除算法. 我们知道,设计数字滤波器,和模拟滤波器的实质,其实就是求一组系数,逼近要求的频率响应. 模拟滤波器已经很成熟,因此,数字滤波器的设计,将S平面映射到Z ...