本文主要是介绍PAT甲级 1058 A+B in Hogwarts,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
PAT甲级 1058 A+B in Hogwarts
#include<bits/stdc++.h>
using namespace std;
int main()
{
#ifdef LOCALfreopen("input.txt", "r", stdin);//freopen("output.txt", "w", stdout);
#endiflong long sickle, galleon, knut;scanf("%lld.%lld.%lld", &galleon, &sickle, &knut);long long A = galleon * 17 * 29 + sickle * 29 + knut;scanf("%lld.%lld.%lld", &galleon, &sickle, &knut);long long B = galleon * 17 * 29 + sickle * 29 + knut;long long A_add_B = A + B;printf("%lld.%lld.%lld",A_add_B / 493, A_add_B / 29 % 17, A_add_B % 29);
}
这篇关于PAT甲级 1058 A+B in Hogwarts的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!