patA A+B in Hogwarts

#include <iostream>
#include <cstdio>
using  namespace std;
const int G=17*29;
const int S=29;
int main(int argc, char** argv) {
int g1,s1,k1,g2,s2,k2;
scanf("%d.%d.%d %d.%d.%d",&g1,&s1,&k1,&g2,&s2,&k2);
int a1=g1*G+s1*S+k1;
int a2=g2*G+s2*S+k2;
int sum=a1+a2;
printf("%d.%d.%d",sum/G,(sum%G)/S,sum%29);
return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_37816373/article/details/79944196