1037 在霍格沃茨找零钱 (20 分)

#include



int main()
{

    int G, S, K, g, s, k;
    int Sum, sum, gap;
    scanf("%d.%d.%d", &G, &S, &K);
    scanf("%d.%d.%d", &g, &s, &k);

    Sum = (G*17+S)*29 + K;
    sum = (g*17+s)*29 + k;
    gap = sum - Sum;

    int gN, sN, kN;
    kN = gap % 29;
    sN = gap / 29 % 17;
    gN = gap / 29 / 17;




    printf("%d.%d.%d", gN, abs(sN), abs(kN));

}

你可能感兴趣的:(1037 在霍格沃茨找零钱 (20 分))