1058 A+B in Hogwarts (20 分)
题目大意
不同进制进行加法。
首先全部相加,然后,在进行进1,超过直接取模,然后高位加1
代码复现
#include "iostream"
#include "vector"
#include "algorithm"
using namespace std;
typedef long long ll;
//10的7次超过int
int main(){
ll a,b,c;
scanf("%lld.%lld.%lld",&a,&b,&c);
ll a1,b1,c1;
scanf("%lld.%lld.%lld",&a1,&b1,&c1);
a+=a1;
b+=b1;
c+=c1;
b+=c/29;
c=c%29;
a+=b/17;
b=b%17;
printf("%lld.%lld.%lld",a,b,c);
return 0;
}