#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<string>
#include<set>
#include<stack>
#include<queue>
using namespace std;
int main(){
int a3,a2,a1,b3,b2,b1,s3,s2,s1;
int carry;
scanf("%d.%d.%d %d.%d.%d",&a3,&a2,&a1,&b3,&b2,&b1);
int temp = a1 + b1;
s1 = temp % 29;
carry = temp / 29;
temp = a2 + b2 + carry;
s2 = temp % 17;
carry = temp /17;
temp = a3 + b3 + carry;
s3 = temp;
printf("%d.%d.%d",s3,s2,s1);
}1058. A+B in Hogwarts (20)
最新推荐文章于 2022-03-01 16:06:52 发布
本文介绍了一个简单的 IP 地址加法器程序,该程序使用 C++ 实现,能够将两个点分十进制形式的 IP 地址相加,并正确处理进位问题,输出结果同样为点分十进制形式。
614

被折叠的 条评论
为什么被折叠?



