Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
73590 石晋骁 09能否赴约 C++ Compile Error 0 MS 0 KB 268 2024-05-19 14:07:05

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a; cin >> a; if (1<=a<=7){ if (a=1){ cout << "NO"; }else if(a=3){ cout << "NO"; }else if(a=5){ cout << "NO"; }else { cout << "YES"; }else{ cout << "NO"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:10: warning: comparison of constant '7' with boolean expression is always true [-Wbool-compare]
  if (1<=a<=7){
          ^
Main.cc:6:7: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses]
  if (1<=a<=7){
       ^
Main.cc:7:10: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   if (a=1){
          ^
Main.cc:9:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  }else if(a=3){
              ^
Main.cc:11:14: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  }else if(a=5){
              ^
Main.cc:15:3: error: expected '}' before 'else'
  }else{
   ^