Skip to content

Commit

Permalink
Update 1058. A+B in Hogwarts (20).cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchuo committed Apr 7, 2020
1 parent 1be430b commit 92142b8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions AdvancedLevel_C++/1058. A+B in Hogwarts (20).cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <iostream>
using namespace std;
int main() {
long long a, b, c, d, e, f;
scanf("%lld.%lld.%lld %lld.%lld.%lld", &a, &b, &c, &d, &e, &f);
long long num = c + b * 29 + a * 29 * 17 + f + e * 29 + d * 29 * 17;
long long g = num / (17 * 29);
num = num % (17 * 29);
printf("%lld.%lld.%lld", g, num / 29, num % 29);
int a1, b1, c1, a2, b2, c2, a, b, c;
scanf("%d.%d.%d %d.%d.%d", &a1, &b1, &c1, &a2, &b2, &c2);
c = c1 + c2;
b = b1 + b2 + c / 29; c = c % 29;
a = a1 + a2 + b / 17; b = b % 17;
printf("%d.%d.%d\n", a, b, c);
return 0;
}

0 comments on commit 92142b8

Please sign in to comment.