Problem greeting
User rhea61
Submission Time 2023-11-08 12:48:02
Score 0
Max Time N/A
Max Memory N/A

Compile Error

greeting.cpp: In function ‘int main()’:
greeting.cpp:7:3: error: expected initializer before ‘cin’
7 | cin>>s;
| ^~~
greeting.cpp:8:25: error: invalid operands of types ‘const char [2]’ and ‘const char [25]’ to binary ‘operator+’
8 | string greeting = "s" + "ni hao, xin nian kuai le";
| ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | const char [25]
| const char [2]
greeting.cpp:9:16: error: expected primary-expression before ‘greeting’
9 | cout<< string greeting
| ^~~~~~~~