也考虑到数据的区间越界问题了···
#include<iostream>
#include<cstring>
#include<map>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
int P_G, P_S, P_K;
int A_G, A_S, A_K;
char c;
while(cin>>P_G>>c>>P_S>>c>>P_K)
{
cin>>A_G>>c>>A_S>>c>>A_K;
long long P_Sum = P_G*17*29 + P_S*29 + P_K;
long long A_Sum = A_G*17*29 + A_S*29 + A_K;
int K = ( P_Sum + A_Sum )%29;
int S = (( P_Sum + A_Sum )/29)%17;
int G = (( P_Sum + A_Sum )/29)/17;
cout<<G<<'.'<<S<<'.'<<K<<endl;
}
return 0;
}