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( ...
随机推荐
- Android开发:《Gradle Recipes for Android》阅读笔记(翻译)2.3——用Eclipse ADT导出App
问题: 想在一个已经存在的Eclipse ADT的项目中使用Gradle 解决方案: Eclipse ADT插件可以帮助生成Gradle文件 讨论: Eclipse的ADT插件是在2013年推出Gra ...
- 《从零开始学Swift》学习笔记(Day2)——使用Web网站编写Swift代码
Swift 2.0学习笔记——使用Web网站编写Swift代码 原创文章,欢迎转载.转载请注明:关东升的博客 Swift程序不能在Windows其他平台编译和运行,有人提供了一个网站swiftstub ...
- POJ 2485 Highways【最小生成树最大权——简单模板】
链接: http://poj.org/problem?id=2485 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22010#probl ...
- Introduction to Mathematical Thinking - Week 9
错题 评分出错 题目要求的是 "any" ,而答案只给出了一个.所以认为回答者没有理解题意,连 any 都没有理解.所以 0 分. 第一,标准的归纳法只能对自然数使用,而题目要求的 ...
- C#窗体传值
整理一下: 1.静态变量传值,非常简单适合简单的非实例的 public calss form1:Form{ public static int A; } public class form2:Form ...
- php cmd 不能利用$_COOKIE 的处理 通过文件来暂存字符串
路径 <?php define('CMDPATH', 'wD:\cmd\\'); echo CMDPATH; die(); broswer 路径无问题 w 读 用 <?php $wfile ...
- PL/SQL 入门
1. 概述 PL/SQL(Procedure Language/SQL)是 Oracle 对 sql 语言的过程化扩展,指在 SQL 命令语言中增加了 过程处理语句(如分支,循环等),使 SQL 语言 ...
- 理解spring中的BeanFactory和FactoryBean的区别与联系
原文地址:http://blog.csdn.net/joenqc/article/details/66479154 首先,这俩都是个接口… 实现 BeanFactory 接口的类表明此类事一个工厂,作 ...
- Network Basic Knowledge
@1: 应用层的常用协议以及对应的端口号: DNS 53/tcp/udp SMTP 25/tcp POP3 110/tcp HTTP 80/tcp HTTPS 443/udp TELNET 23/tc ...
- 设置linux下shell显示不同颜色的字体
实例代码如下: #!/bin/bash clear echo -e "\033[1m Hello World" # bold effect echo -e "\033[5 ...