当前位置:首页 > 技术杂谈 > 正文

1037 在霍格沃茨找零钱

2024-03-31 技术杂谈

水题。

#include<iostream>
#include<algorithm>
using namespace std;

typedef long long LL;
int main() {
    LL G1,S1,K1,G2,S2,K2;
    scanf("%lld.%lld.%lld %lld.%lld.%lld",&G1,&S1,&K1,&G2,&S2,&K2);
    K1  = S1*29 G1*17*29;
    K2  = S2*29 G2*17*29;
    if(K1 > K2) {
        cout<<"-";
        swap(K1,K2);
    }
    LL t = K2-K1;
    printf("%lld.%lld.%lld",t/(17*29),t%(17*29)/29,t%29);
    return 0;
}

 

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/a/17244.html