【PAT甲级】1058. A+B in Hogwarts (20)
来源:互联网 发布:mac已导入照片怎么删除 编辑:程序博客网 时间:2024/06/05 19:58
#include <stdio.h>int main(int argc, char *argv[]) { int radix[2] = {29, 17}; int a[3]; int b[3]; int sum[3]; scanf("%d.%d.%d %d.%d.%d", &a[2], &a[1], &a[0], &b[2], &b[1], &b[0]); for (int i = 0; i < 3; i++) { sum[i] = a[i] + b[i]; } for (int i = 0; i < 2; i++) { int t; if ((t = sum[i] / radix[i]) > 0) { sum[i + 1] += t; sum[i] = sum[i] % radix[i]; } } for (int i = 2; i >= 0; i--) { if (i < 2) printf("."); printf("%d", sum[i]); } printf("\n"); return 0;}
0 0
- 1058. A+B in Hogwarts (20)-PAT甲级真题
- PAT甲级.1058. A+B in Hogwarts (20)
- 【PAT甲级】1058. A+B in Hogwarts (20)
- 1058. A+B in Hogwarts (20) PAT 甲级
- PAT甲级练习1058. A+B in Hogwarts (20)
- PAT甲级1058. A+B in Hogwarts (20)
- 1058. A+B in Hogwarts (20)-PAT甲级
- PAT 甲级 1058. A+B in Hogwarts (20)
- PAT(甲级)A+B in Hogwarts (20)
- 1058. A+B in Hogwarts (20)- PAT
- 【PAT】1058. A+B in Hogwarts (20)
- PAT 1058. A+B in Hogwarts (20)
- PAT 1058. A+B in Hogwarts (20)
- pat 1058. A+B in Hogwarts (20)
- PAT 1058. A+B in Hogwarts (20)
- PAT 1058. A+B in Hogwarts (20)
- PAT---1058. A+B in Hogwarts (20)
- PAT甲级真题及训练集(14)--1058. A+B in Hogwarts (20)
- 数据库学习笔记和小练习(1)数据定义
- shell 脚本
- JQUERY获取当前页面的URL信息
- mybatis逆向工程进行不同条件查询的应用处理
- leetCode练习(121)
- 【PAT甲级】1058. A+B in Hogwarts (20)
- iOS系统字体大全,iOS系统中所有的字体
- PHP interface和abstract理解
- phpstorm10.0.3破解版安装教程及汉化方法
- max(min)-device-width和max(min)-width的区别
- 近期学习目标
- JavaScript 特殊字符转义字符对照表
- 微信开发预览接口
- android关于三星手机自定义相机拍照后照片旋转90度解决方案