PAT1058. A+B in Hogwarts (20)
#include <iostream> using namespace std;
int ag,as,ak;
int bg,bs,bk;
int cg,cs,ck;
int main(){
scanf("%d.%d.%d",&ag,&as,&ak);
scanf("%d.%d.%d",&bg,&bs,&bk);
int c1=(ak+bk)/29;
ck=(ak+bk)%29;
int c2=(as+bs+c1)/17;
cs=(as+bs+c1)%17;
cg=ag+bg+c2;
printf("%d.%d.%d",cg,cs,ck);
return 0;
}
PAT1058. A+B in Hogwarts (20)的更多相关文章
- PAT1058:A+B in Hogwarts
1058. A+B in Hogwarts (20) 时间限制 50 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue If you ...
- A1058 A+B in Hogwarts (20)(20 分)
A1058 A+B in Hogwarts (20)(20 分) If you are a fan of Harry Potter, you would know the world of magic ...
- 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-1058 A+B in Hogwarts (进制转换)
1058. A+B in Hogwarts If you are a fan of Harry Potter, you would know the world of magic has its ow ...
- 1058 A+B in Hogwarts (20)
#include <stdio.h> int main() { ]; ]; ],&ans1[],&ans1[],&ans2[],&ans2[],&a ...
- PAT (Advanced Level) 1058. A+B in Hogwarts (20)
简单题. #include<cstdio> #include<cstring> #include<cmath> #include<vector> #in ...
- PAT甲题题解-1058. A+B in Hogwarts (20)-大水题
无语,这种水题还出,浪费时间,但又不得不A... #include <iostream> #include <cstdio> #include <algorithm> ...
- PAT A1058 A+B in Hogwarts (20)
AC代码 #include <cstdio> struct Money { long long Galleon, Sicklke, Knut; }A, B, Sum; void init( ...
随机推荐
- iOS学习笔记(二)——Hello iOS
前面写了iOS开发环境搭建,只简单提了一下安装Xcode,这里再补充一下,点击下载Xcode的dmp文件,稍等片刻会有图一(拖拽Xcode至Applications)的提示,拖拽至Applicatio ...
- T-SQL 合并多行数据显示到一行
思路: 自连接,使用For XML Path('')和STUFF函数 SELECT * FROM STUDENT Name Team------------- ...
- 写给上C语言课的孩子们
前几天因为五一的关系,参加了好几次同学会,有一些感触和大家分享,到了我们这个年纪,同学们大多家庭.事业小有成就,对自己会有激励,在有的同学显摆自己的车房.电子设备.身家时,忽然想一个人的成熟应该是慢慢 ...
- java内部类详细介绍
0.内部类与一般类有所不同,它是放在外部类的内部即可作为外部类的成员变量,也可放在方法内部作为局部变量,既然是变量,那么它可以用 private static 修饰符修饰,而外部类则不能,这也是内部类 ...
- SpringBoot使用H2内嵌数据库
1.驱动 我们知道,JDBC是JDK自带的接口规范,不同的数据库有不同的实现,只需要引入相应的驱动包即可. 在使用MySQL数据库时,引入的是MySQL驱动,相应的,使用H2数据库时,也需要引入H2驱 ...
- 网络免费API接口整理
转载自: https://www.cnblogs.com/doit8791/p/9351629.html 从网上看到一些免费API接口,在个人开发小程序等应用练手时可试用. 各类无次数限制的免费API ...
- WIN文件放到LINUX中无法CAT过滤的解决方法
有个WIN文件放到LINUX服务器上处理的时候,由于编码的问题,导致无法过滤,此时需要对文件进行处理 cat file | tr -s "\r" "\n" &g ...
- python 时间模块小结
python有两个重要的时间模块,分别是time和datetime time模块 表示时间的几种方法 时间元组 time.struct_time( tm_year=2016, tm_mon=7, tm ...
- bzoj3007 解救小云公主
3007: 解救小云公主 Time Limit: 5 Sec Memory Limit: 512 MB Submit: 159 Solved: 71 [id=3007" style=&q ...
- Linux中的输出重定向
标准输入输出: 键盘 /dev/stdin 0 标准输入 显示器 /dev/stdout 1 标准输出 显示器 /dev/st ...