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], 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
#include<iostream>
using namespace std;
struct money{
int g;
int s;
int k;
};
int main() {
money a,b,res;
scanf("%d.%d.%d %d.%d.%d",&a.g,&a.s,&a.k,&b.g,&b.s,&b.k);
res.g=a.g+b.g;
res.s=a.s+b.s;
res.k=a.k+b.k;
if(res.k>){
res.k-=;
res.s++;
}
if(res.s>){
res.s-=;
res.g++;
}
cout<<res.g<<"."<<res.s<<"."<<res.k;
system("pause");
return ;
}

最新文章

  1. [LeetCode] Remove K Digits 去掉K位数字
  2. Mysql两个引擎对比
  3. Python 爬虫5——爬取并下载网页指定规格的图片
  4. Windows 7您的凭据不工作
  5. dnspod动态域名使用感受
  6. js对select动态添加和删除OPTION
  7. lib制作
  8. DevExpress gridView 小结(一)
  9. Flume学习——Flume中事务的定义
  10. Android: 在WebView中获取网页源码
  11. Ext JS学习第十二天 Ext基础之操作dom ; get与fly 方法
  12. thinkphp系列:类的自动加载是如何设计的
  13. Flask学习 一 基本结构
  14. iOS masonry 不规则tagView布局 并自适应高度
  15. 2018-2019-2 20165328《网络对抗技术》Exp0 Kali安装week1
  16. react 自我小计
  17. Ubuntu 14.04 + gnome session back (metacity) 任务栏右上角图标消失问题解决
  18. cocos2d-js 3.0 rc2 自定义UI控件组件 例子:能播放动画的MenuItem。MenuItemSprite的bug
  19. 13 jmeter性能测试实战--FTP程序
  20. ExtJS模版技术

热门文章

  1. 错误1919,配置ODBC数据源MS Access Database时发生错误ODEC错误
  2. 数据库MySQL(课下作业,必做) 20175225
  3. C# 读取Excel中的数据到DataTable中
  4. 【零售App】—— react/ant design mobile项目爬坑
  5. lnmp源码搭建
  6. 怎么用jira写bug
  7. hashMap与 hashTable , ArrayList与linkedList 的区别(详细)
  8. 【MyBatis】-----【MyBatis】---表级联系【一对一】--增删改查
  9. Matlab——图形绘制——三维立体图形 剔透玲珑球 动态图——彗星状轨迹图
  10. Django 优秀资源大全