现在的位置: 首页 > 综合 > 正文

浙大PAT 1058题 1058. A+B in Hogwarts

2018年05月26日 ⁄ 综合 ⁄ 共 235字 ⁄ 字号 评论关闭
#include<stdio.h>
#include<stdlib.h>
int main(){
	int a,b,c,d,e,f,h,i,j;
	scanf("%d.%d.%d ",&a,&b,&c);
	scanf("%d.%d.%d",&d,&e,&f);
	h=i=j=0;
	j=(c+f)%29;
	i=((c+f)/29+b+e)%17;
	h=((c+f)/29+b+e)/17+a+d;
	printf("%d.%d.%d\n",h,i,j);
	system("pause");
	return 0;
}

抱歉!评论已关闭.