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( ...
随机推荐
- 【BZOJ3502/2288】PA2012 Tanie linie/【POJ Challenge】生日礼物 堆+链表(模拟费用流)
[BZOJ3502]PA2012 Tanie linie Description n个数字,求不相交的总和最大的最多k个连续子序列. 1<= k<= N<= 1000000. Sam ...
- 《从零开始学Swift》学习笔记(Day 8)——小小常量、变量大作用
原创文章,欢迎转载.转载请注明:关东升的博客 计算机语言学习中都有常量和变量,他们几乎是我编写代码的灵魂了,离开他们我真的是“活不了” 常量是标识符的前面加上关键字let.常量其值在使用过程中不会 ...
- 合并子目录(hash)
题目2 : 合并子目录 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi的电脑的文件系统中一共有N个文件,例如: /hihocoder/offer22/soluti ...
- java.lang.ClassFormatError: Truncated class file
之前跑的很好的程序,因为我本地IDE出了问题的原因,倒是编译的错误的class文件,结果点击的时候报这样的错误,后来重新clean了工程,重新打包解压启动,问题依旧. 解决办法: 把tomcat的wo ...
- (转)免费天气预报接口API以及全国所有地区代码!!
国家气象局提供的天气预报接口 接口地址: http://www.weather.com.cn/data/sk/101010100.html http://www.weather.com.cn/data ...
- Architectural Styles and the Design of Network-based Software Architectures
w Architectural Styles and the Design of Network-based Software Architectures http://www.ics.uci.ed ...
- [转载]Apache在windows下的安装配置
Apache在windows下的安装配置 转载自:http://blog.sina.com.cn/s/blog_536f16b00100cfat.html 1 Apache的下载 Apache ...
- win8内置管理员账号既能使用metro应用又能使用默认共享
一.内置管理员账号打开METRO应用 1.按WIN+R 弹出运行框. 2.输入gpedit.msc点确定,打开本地组策略编辑器. 3.逐级选择“计算机配置”,“Windows 设置”,“安全设置”,“ ...
- Spring学习笔记3—声明式事务
1 理解事务 事务:在软件开发领域,全有或全无的操作被称为事务.事务允许我们将几个操作组合成一个要么全部发生要么全部不发生的工作单元. 事务的特性: 原子性:事务是由一个或多个活动所组成的一个工作单元 ...
- boost之算法
STL里的算法已经很好了,在boost里有几个小的算法 1.BOOST_FOREACH使用方法,定义一个容器里内部类型数据,容器作为参数传递. #include <iostream> #i ...