Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
115867 晏莞煜 13判断质数 C++ Compile Error 0 MS 0 KB 272 2025-04-05 14:27:26

Tests(0/0):


Code:

#include <iostream> using namespace std; int main(){ int n,q; cin>>n; q=0; for(int a=2;a<n;a++){ if(n%a!=0){ q=1; } } if(q=1){ cout<<"No" }else{ cout<<"Yes"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
     if(q=1){
           ^
Main.cc:14:5: error: expected ';' before '}' token
     }else{
     ^