PAT甲题题解-1058. A+B in Hogwarts (20)-大水题
2017-03-06 18:35
399 查看
无语,这种水题还出,浪费时间,但又不得不A。。。
View Code
#include <iostream> #include <cstdio> #include <algorithm> #include <string.h> #include <cmath> #define SICKLE 17 #define KNUT 29 using namespace std; int a1,a2,a3; int b1,b2,b3; int main() { scanf("%d.%d.%d %d.%d.%d",&a1,&a2,&a3,&b1,&b2,&b3); int r1=0,r2=0,r3=0; r3=a3+b3; if(r3>=KNUT){ r3-=KNUT; r2++; } r2+=a2+b2; if(r2>=SICKLE){ r2-=SICKLE; r1++; } r1+=a1+b1; printf("%d.%d.%d\n",r1,r2,r3); return 0; }
View Code
相关文章推荐
- 浙江大学PAT_甲级_1058. A+B in Hogwarts (20)
- PAT-A-1058. A+B in Hogwarts (20)
- 【PAT】A1058. 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-A 1058. A+B in Hogwarts (20)
- 【PAT (Advanced Level)】1058. A+B in Hogwarts (20)
- PAT (Advanced Level) 1058. A+B in Hogwarts (20) 字符串相加
- PAT 1058. A+B in Hogwarts (20)
- PAT---1058. A+B in Hogwarts (20)
- PAT (Advanced Level) Practise 1058 A+B in Hogwarts (20)
- PAT 1058. A+B in Hogwarts (20)(简单加法)(待修改)
- 【PAT】【Advanced Level】1058. A+B in Hogwarts (20)
- 【PAT】1058. A+B in Hogwarts (20)
- PAT 甲级 1058. A+B in Hogwarts (20)
- PAT (Advanced Level) Practise 1058 A+B in Hogwarts (20)
- 【c++】PAT(advanced level)1058. A+B in Hogwarts (20)