无语,这种水题还出,浪费时间,但又不得不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. ndroid动态创建按钮并添加事件

    public class MyActivity extends Activity { /** * Called when the activity is first created. */ @Over ...

  2. 笔记本键盘开关方法 仅限window系统

    按win键,搜索CMD(命令提示符).右键-以管理员身份运行.关闭笔记本键盘输入:sc config i8042prt start= disabled回车-重启电脑即可.需要重新启用键盘的话,输入:s ...

  3. Windows Server 2008远程桌面端口更改方法

    win2008远程桌面端口默认是用的是3389端口,但是由于安全考虑,经常我们安装好系统后一般都会考虑把原来的3389端口更改为另外的端口.本文以改为端口为25608商品为例,讲解一下具体操作过程. ...

  4. 夯实基础之--new关键字、instanceOf原理

    1.instanceOf原理  检测右边构造函数的prototype是否在左边对象的原型链上,在返回true,不在返回false 例:function  Persion(name,age){ this ...

  5. 【洛谷】【单调栈】P4333 [COI2007] Patrik

    --接上一篇题解,[洛谷][单调栈]P1823音乐会的等待 关于题目大意在上一篇题解里已经说清楚了,这里不再多阐述 想看题目->戳这里 [算法分析:] 在对元素a进行判断时,如果它与栈顶元素相等 ...

  6. 【转】浅谈一个网页打开的全过程(涉及DNS、CDN、Nginx负载均衡等)

    1.概要 从用户在浏览器输入域名开始,到web页面加载完毕,这是一个说复杂不复杂,说简单不简单的过程,下文暂且把这个过程称作网页加载过程.下面我将依靠自己的经验,总结一下整个过程.如有错漏,欢迎指正. ...

  7. mysql 批量修改字段方法

    一.正式环境操作注意事项: .关闭应用访问或者设置数据库只读 mysql设为只读方法: 开启只读: mysql> show global variables like "%read_o ...

  8. OpenCV——查找、绘制轮廓

    #include <opencv2/opencv.hpp> #include <iostream> using namespace cv; using namespace st ...

  9. MSMQ消息队列总结

    1.总体介绍: http://www.cnblogs.com/beniao/archive/2008/06/26/1229934.html 2.windows服务各项参数介绍及安装 https://w ...

  10. 求 1+2+3+ …… +n

    题目来源: 自我感觉难度/真实难度: 题意: 分析: 自己的代码: def Sum_Solution(n): # write code here if n==1: return 1 else: ans ...