1058. A+B in Hogwarts (20)

来源:互联网 发布:车机软件 编辑:程序博客网 时间:2024/04/30 23:43
#include<iostream>int main(){    using namespace std;    int a, b, c, d, e, f;    char x;    cin >> a >> x >> b >> x >> c >> d >> x >> e >> x >> f;    int temp=0;    if (f + c >= 29) { c = c + f - 29;temp = 1; }    else { c += f;temp = 0; }    if (b + e + temp >= 17) { b = b + e + temp - 17; temp = 1;}    else { b = b + e + temp;temp = 0; }    a += d + temp;    cout << a << "." << b << "." << c << endl;}
0 0