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 ...
随机推荐
- 团队作业——Beta冲刺1
团队作业--Beta冲刺 冲刺任务安排 杨光海天 今日任务:开会讨论下,Beta阶段主要的冲刺内容 明日任务:根据冲刺内容,具体分配个人任务,对于冲刺内容做准备 吴松青 今日任务:跟新组员熟悉下,联络 ...
- Alpha- 事后诸葛亮(麻瓜制造者)
目录 预期计划 现实进展 团队体会 成员分工及工作量比例 会议总结 预期计划 在Alpha阶段开始之前,我们的预期计划是:从用户登录,发布商品.发布求购信息的基本功能开始做起.用户登录使用输入教务处的 ...
- p,np,npc,np难问题,确定图灵机与非确定图灵机
本文转自豆瓣_燃烧的影子 图灵机与可计算性 图灵(1912~1954)出生于英国伦敦,19岁进入剑桥皇家学院研究量子力学和数理逻辑.1935年,图灵写出了"论高斯误差函数"的论文, ...
- Fedora 中多显示器环境下的工作区切换
[Dual monitor workspaces] 默认情况下,fedora中 Gnome 桌面环境在切换工作去的时候,只会在 Primary display 上切换, 其他显示器保持不变.如果要实现 ...
- saltstack二次开发(二)
Saltstack的api Salt-api有两种方式,一种是函数的形式,有人家定义好的函数,我们可以直接调用,直接写python代码调用函数或者类就可以了.第二种形式是salt-api有封装好的ht ...
- vue2.0学习笔记之路由(二)路由嵌套+动画
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- os.path.md
os.path 我们可以利用os.path模块提供的函数更容易地在跨平台上处理文件. 即使我们的程序不是用于夸平台, 也应该使用os.path来让路径名字更加可靠. Parsing Paths os. ...
- 八,ESP8266 文件保存数据(基于Lua脚本语言)
https://www.cnblogs.com/yangfengwu/p/7533845.html 应该是LUA介绍8266的最后一篇,,,,,,下回是直接用SDK,,然后再列个12345...... ...
- array_map,array_filter,array_walk区别
这几个方法都有遍历数组,操作的过程. 很容易搞混.尤其很多人养成的编程习惯都是使用foreach来循环遍历.. 就举个简单例子. $a = array( 0,1,2,3,4,5,6,7,8,9 ); ...
- TortoiseSVN 只取下或更新部分文件的方法(Sparse Update/Sparse Checkout)
Sparse Update/Sparse Checkout To easily select only the items you want for the checkout and force ...