0
点赞
收藏
分享

微信扫一扫

A1058 A+B in Hogwarts (20 分)

菜菜捞捞 2023-01-09 阅读 108


18分代码,不知道哪里扣了2分

#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
int a, b, c;
int x, y, z;
scanf("%d.%d.%d %d.%d.%d", &a, &b, &c, &x, &y, &z);

long long int count = 0;
count = a * 17 * 29 + b * 29 + c + x * 17 * 29 + y * 29 + z;

a = count / (17 * 29);
b = (count % (17 * 29)) / 29;
c = count - (a * 17 * 29 + b * 29);

printf("%d.%d.%d", a, b, c);

return 0;
}


举报

相关推荐

0 条评论