PAT1058. A+B in Hogwarts (20)

#include <iostream>

using namespace std;
int ag,as,ak;
int bg,bs,bk;
int cg,cs,ck;
int main(){
	scanf("%d.%d.%d",&ag,&as,&ak);
	scanf("%d.%d.%d",&bg,&bs,&bk);
	int c1=(ak+bk)/29;
	ck=(ak+bk)%29;
	int c2=(as+bs+c1)/17;
	cs=(as+bs+c1)%17;
	cg=ag+bg+c2;
	printf("%d.%d.%d",cg,cs,ck);
    return 0;
}

 

posted @ 2016-03-25 23:12  Yellowman  阅读(113)  评论(0编辑  收藏  举报
TVRBMExqRXlPQzR5TXpjdU1UVTEK\n