无语,这种水题还出,浪费时间,但又不得不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. div中嵌套div水平居中,垂直居中

    方法一: div(父):display:table; div(子):display:table_cell;margin:0 auto;vertical-align:middle; 方法二: div(父 ...

  2. 某某D的手伸的实在太长了,路由器也未能幸免,致被阉割的TP-Link

    前段时间整了个服务器架上l2tp.server, TP-Link路由连上去后,全网走l2tp通道,而且不能配置相关的路由表 然后研究啊 找啊 查啊,确定是路由没有这功能 找客服问了一下,他一听就懂了, ...

  3. 聊聊MySQL的子查询

    1. 背景 在之前介绍MySQL执行计划的博文中已经谈及了一些关于子查询相关的执行计划与优化.本文将重点介绍MySQL中与子查询相关的内容,设计子查询优化策略,包含半连接子查询的优化与非半连接子查询的 ...

  4. php请求API接口方法

    thinkphp下直接放入公共函数即可. /** * 通过URL获取页面信息 * @param string $url 地址 * @return string 返回页面信息 */ function g ...

  5. myEtherWallet在线钱包的使用

    https://www.myetherwallet.com/#generate-wallet myEtherWallet是一款在线钱包,当你不想安装类似metamask这样的插件时,可以选择使用它 1 ...

  6. java字符串利用dom4j转 xml 且遍历

    1.因为转换的格式不是标准格式,所以有时候获得xml根目录后rootElement.attributes() 取不到想要的属性 所以需要通过迭代器来获取想要的值 public static void ...

  7. Win10环境Tensorflow-GPU13.1/JupyterNotebook的安装

    参考 : Anaconda Tensorflow GPU 版本的安装问题 https://blog.csdn.net/u010977034/article/details/62038698 Windo ...

  8. dbca时报错:ORA-12705(NLS_LANG=AMERICAN_AMERICA.UTF8);

    #add by zexport ORACLE_BASE=/u01/oracle export ORACLE_HOME=/u01/oracle/11.02 export ORACLE_SID=z exp ...

  9. Mysql 调优2个语句

    一.explain 语句 查看语句的执行计划 二.查看具体每一步耗时 .; .执行SQL .show profiles; 获取2执行SQL的query_id .show profile for que ...

  10. ssh访问服务器端visdom

    在服务器端启动visdompython -m visdom.server在windows端,将服务器的8097端口重定向到windows端(做了映射绑定):ssh -L 8097:127.0.0.1: ...