1 #include<cstdio> 2 int main(){ 3 int a[3], b[3], c[3], cont = 0; 4 scanf("%d.%d.%d %d.%d.%d",&a[0], &b[0], &c[0], &a[1], &b[1], &c[1]); 5 c[2] = ( c[0] + c[1] ) % 29; 6 cont = ( c[0] + c[1] ) / 29; 7 b[2] = ( b[0] + b[1] + cont ) % 17; 8 cont = ( b[0] + b[1] + cont ) / 17; 9 a[2] = a[0] + a[1] + cont; 10 printf("%d.%d.%d", a[2], b[2], c[2] ); 11 return 0; 12 }
原文地址:https://www.cnblogs.com/zjsaipplp/p/10415809.html
时间: 2024-11-03 04:17:38