1058 A+B in Hogwarts (20 分)
If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it's easy enough." Your job is to write a program to compute A+B where A and B are given in the standard form of Galleon.Sickle.Knut(Galleon is an integer in [0,107], Sickle is an integer in [0, 17), and Knut is an integer in [0, 29)).
Input Specification:
Each input file contains one test case which occupies a line with A and B in the standard form, separated by one space.
Output Specification:
For each test case you should output the sum of A and B in one line, with the same format as the input.
Sample Input:
3.2.1 10.16.27
Sample Output:
14.1.28
分析:水题,注意可能溢出,用long long保险点
 /**
 * Copyright(c)
 * All rights reserved.
 * Author : Mered1th
 * Date : 2019-02-24-01.29.25
 * Description : A1058
 */
 #include<cstdio>
 #include<cstring>
 #include<iostream>
 #include<cmath>
 #include<algorithm>
 #include<string>
 #include<unordered_set>
 #include<map>
 #include<vector>
 #include<set>
 using namespace std;
 int main(){
 #ifdef ONLINE_JUDGE
 #else
     freopen("1.txt", "r", stdin);
 #endif
     int b,c;
     int e,f;
     ,i=;
     ;
     scanf("%lld.%d.%d %lld.%d.%d",&a,&b,&c,&d,&e,&f);
     i=f+c;
     ){
         i-=;
         h++;
     }
     h=h+b+e;
     ){
         h-=;
         g++;
     }
     g=g+a+d;
     printf("%lld.%d.%d",g,h,i);
     ;
 }
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 Advanced 1058 A+B in Hogwarts (20 分)
		
If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- a ...
 - 【PAT甲级】1058 A+B in Hogwarts (20 分)
		
题意: 输入两组,每组三个非负整数A,B,C(A<=1e7,B<17,C<29),输出相加的和.(类似个位上29进制,十位上17进制运算) AAAAAccepted code: #d ...
 - 1058 A+B in Hogwarts (20分)(水)
		
If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- a ...
 - 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 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 has i ...
 
随机推荐
- 【LeetCode 234_链表】Palindrome Linked List
			
ListNode* ReverseList(ListNode *p) { if (p == NULL || p->next == NULL) return p; ListNode *pre = ...
 - 团队项目之UML图设计
			
团队 学号 姓名 本次作业博客链接 031602428 苏路明(组长) https://www.cnblogs.com/Sulumer/p/9822854.html 031602401 陈瀚霖 htt ...
 - SQL SERVER 压缩数据库日志文件
			
ALTER DATABASE DBNAME SET RECOVERY SIMPLE --设置为简单恢复模式 GO DBCC SHRINKFILE (DBNAME_log, 1) GO ALTER DA ...
 - CentOS 下安装和使用 Docker
			
引言: 在服务器开发过程中,环境部署无疑是及其繁琐的事情,特别是当项目数量和规模达到一定级别之后,在一台新的机器上部署项目环境无疑是极其漫长而痛苦的,那么什么办法能够实现我们的目标:在开发环境的一次配 ...
 - Vue 2.0 学习路线
			
「 Vue很难学吗 」 对于我这种从0.x版本就开始体验 vuejs 的人来说,当然不算难,那时候没各种脚手架和复杂搭配,仅仅是一个mvvm的解决方案库而已,解决了jq带来的繁琐操作dom痛点,所以就 ...
 - OpenCV-bwLabel-实现图像连通组件标记与分析
			
OpenCV实现图像连通组件标记与分析- matlab bwLabel; code: #include <opencv2/opencv.hpp> #include <iostream ...
 - NVIDIA GeForce GTX 960 设备是不可移动的,无法弹出
			
系统环境 系统:win7_x64; matlab版本:matlab2017b试用版: GPU:NVIDIA GeForce GTX 960: 问题描述: 第一次使用深度学习实现代码,运行的是matla ...
 - C++ 备忘录 (1)
			
取模: 1. 转载自:http://ceeji.net/blog/mod-in-real/ 背景 最近在一道 Java 习题中,看到这样的一道题: What is the output when th ...
 - 关于FormData及其用法
			
XMLHttpRequest Level 2添加了一个新的接口FormData.利用FormData对象,我们可以通过JavaScript用一些键值对来模拟一系列表单控件,我们还可以使用XMLHttp ...
 - HPU 1166: 阶乘问题(一)
			
1166: 阶乘问题(一) [数学] 时间限制: 1 Sec 内存限制: 128 MB提交: 58 解决: 24 统计 题目描述 小H对阶乘!很感兴趣.现在他想知道N!N!的位数,由于NN太大了,所以 ...