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 ...
随机推荐
- SQLSERVER无排序生成序号
实现方式:ROW_NUMBER() SELECT RowID=(ROW_NUMBER() OVER(ORDER BY(SELECT ))) FROM dbo.tbl_name 实现方式:IDENTIT ...
- Alpha冲刺报告(3/12)(麻瓜制造者)
今日已完成情况: 肖小强: 解决了之前的部署demo问题,学习了基本需要的api 江郑: 进行发布需求数据库的增删改查 邓弘立: 完成了轮播图的设计 刘双玉: 编码发布商品的接口,数据库表的修改 汪志 ...
- 有关于分布式缓存Hazelcast
如果在内网段中部署或者启动缓存服务.不能存在相同的组名称.如同使用dubbo一样,会导致无法连接到缓存节点
- js 毫秒转换为标准时间
function dateForm(time){ var unixTimestamp = new Date( 1477386005*1000 ); commonTime = unixTimestamp ...
- HTML标签之marquee
版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/zkn_CS_DN_2013/article/details/25229719 <html> ...
- PHP百万级数据导出方案(多csv文件压缩)
本文转自网络仅供学习之用 概述: 最近公司项目要求把数据除了页面输出也希望有导出功能,虽然之前也做过几个导出功能,但这次数据量相对比较大,差不多一天数据就20W条,要求导7天或者30天,那么数据量就轻 ...
- ORA-27125: unable to create shared memory segment的解决方法(转)
ORA-27125: unable to create shared memory segment的解决方法(转) # Kernel sysctl configuration file for Red ...
- 简单的Tab切换组件
由于代码都有注释,所以不多加解释,大家都知道的.直接贴代码: 代码如下: /** * 简单的Tab切换 * 支持可配置项 如下参数 */ function Tab(){ this.config = { ...
- PAT A1009 Product of Polynomials (25 分)——浮点,结构体数组
This time, you are supposed to find A×B where A and B are two polynomials. Input Specification: Each ...
- CentOS7服务器添加新用户
添加新用户[root@localhost etc]# adduser jiangshan[root@localhost etc]# passwd jiangshan[root@localhost et ...