QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#204169#5279. New TimeOverLoadCompile Error//Python3563b2023-10-07 04:46:332023-10-07 04:46:34

Judging History

你现在查看的是最新测评结果

  • [2023-10-07 04:46:34]
  • 评测
  • [2023-10-07 04:46:33]
  • 提交

answer

#include <iostream>
#include <string>
using namespace std;
int main() {
    string a;
    cin >> a;
    int minute = (a[0] - '0') * 10 + (a[1] - '0') * 60 + (a[3] - '0') * 10 + (a[4] - '0');

    std::cin >> a;
    int real_minute = (a[0] - '0') * 10 + (a[1] - '0') * 60 + (a[3] - '0') * 10 + (a[4] - '0');

    int real = real_minute - minute;

    if (real >= 0) {
        cout << real / 60 << real % 60 << std::endl;
    } else if (real < 0) {
        std::cout << (1440 + real) / 60 << (1440 + real) % 60 << std::endl;
    }
    return 0;
}

詳細信息

  File "answer.code", line 3
    using namespace std;
          ^^^^^^^^^
SyntaxError: invalid syntax