货币转换,“Seventeen silver Sickles to a Galleon and twenty-nine Knuts to a Sickle, it’s easy enough.”
sum = sum % (17 29)的值最大为28+1629 < 17*29。
`
c++
#include
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 sum = c + b 29 + a 17 29 + f + e 29 + d 17 29;
long long g = sum / (17 29);
sum = sum % (17 29);
printf(“%lld.%lld.%lld”, g, sum / 29, sum % 29);
return 0;
}
3.2.1 10.16.27
14.1.28