QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#279754#7779. Swiss Stageucup-team1074#Compile Error//C++23167b2023-12-09 08:09:502023-12-09 08:09:50

Judging History

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

  • [2023-12-09 08:09:50]
  • 评测
  • [2023-12-09 08:09:50]
  • 提交

answer

#define<bits/stdc++..h>
using namespace std;
int main(){
    int x , y;
cin >> x >> y;
if(y == 2){
cout << (3 - x ) * 2 ;
}
else{
cout << 1 + (3 - x ) ;
}
}

Details

answer.code:1:8: error: macro names must be identifiers
    1 | #define<bits/stdc++..h>
      |        ^
answer.code: In function ‘int main()’:
answer.code:5:1: error: ‘cin’ was not declared in this scope
    5 | cin >> x >> y;
      | ^~~
answer.code:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
  +++ |+#include <iostream>
    1 | #define<bits/stdc++..h>
answer.code:7:1: error: ‘cout’ was not declared in this scope
    7 | cout << (3 - x ) * 2 ;
      | ^~~~
answer.code:7:1: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
answer.code:10:1: error: ‘cout’ was not declared in this scope
   10 | cout << 1 + (3 - x ) ;
      | ^~~~
answer.code:10:1: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?