F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_39763598_32634.cpp:2:9: error: cannot declare '::main' to be a global variable
    2 |     int main{
      |         ^~~~
0_0_39763598_32634.cpp:3:9: error: expected primary-expression before 'int'
    3 |         int a=1,b=5,c=10,d=20;
      |         ^~~
0_0_39763598_32634.cpp:3:9: error: expected '}' before 'int'
0_0_39763598_32634.cpp:2:13: note: to match this '{'
    2 |     int main{
      |             ^
0_0_39763598_32634.cpp:4:15: error: expected constructor, destructor, or type conversion before '(' token
    4 |         printf("%d\n%d",a+b,c+d);
      |               ^
0_0_39763598_32634.cpp:5:9: error: expected unqualified-id before 'return'
    5 |         return 0;
      |         ^~~~~~
0_0_39763598_32634.cpp:6:1: error: expected declaration before '}' token
    6 | }
      | ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2025 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.001000(s) query 1, Server time : 2025-02-28 08:49:53, Gzip enabled