QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#204172#5279. New TimeOverLoadCompile Error//C++23682b2023-10-07 04:50:372023-10-07 04:50:38

Judging History

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

  • [2023-10-07 04:50:38]
  • 评测
  • [2023-10-07 04:50:37]
  • 提交

answer

 var a = Console.ReadLine();
            var minute = Convert.ToInt32((a[0])) * 10 + Convert.ToInt32(a[1]) * 60 + Convert.ToInt32(a[3]) * 10 + Convert.ToInt32(a[4]);
            a = Console.ReadLine();
            var real_minute = Convert.ToInt32(a[0]) * 10 + Convert.ToInt32(a[1]) * 60 + Convert.ToInt32(a[3]) * 10 + Convert.ToInt32(a[4]);

            var real = real_minute - minute;

            if (real > 0)
            {
                Console.WriteLine(Convert.ToInt32(real / 60) + real % 60);
            }
            else if(real < 0)
            {
                Console.WriteLine(Convert.ToInt32((1440 + real) / 60) + (1440 + real) % 60);
            }

詳細信息

answer.code:1:2: error: ‘var’ does not name a type
    1 |  var a = Console.ReadLine();
      |  ^~~
answer.code:2:13: error: ‘var’ does not name a type
    2 |             var minute = Convert.ToInt32((a[0])) * 10 + Convert.ToInt32(a[1]) * 60 + Convert.ToInt32(a[3]) * 10 + Convert.ToInt32(a[4]);
      |             ^~~
answer.code:3:13: error: ‘a’ does not name a type
    3 |             a = Console.ReadLine();
      |             ^
answer.code:4:13: error: ‘var’ does not name a type
    4 |             var real_minute = Convert.ToInt32(a[0]) * 10 + Convert.ToInt32(a[1]) * 60 + Convert.ToInt32(a[3]) * 10 + Convert.ToInt32(a[4]);
      |             ^~~
answer.code:6:13: error: ‘var’ does not name a type
    6 |             var real = real_minute - minute;
      |             ^~~
answer.code:8:13: error: expected unqualified-id before ‘if’
    8 |             if (real > 0)
      |             ^~
answer.code:12:13: error: expected unqualified-id before ‘else’
   12 |             else if(real < 0)
      |             ^~~~