Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
90236 张永良 素数判断 C++ Compile Error 0 MS 0 KB 248 2024-09-08 13:12:51

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int a,f=0; cin>>a; for(int i=2;i<a;i++){ if(a%i==0){ f=1; } } if(f=0){ cout<<"prime" }else cout<<"not prime" return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:13:10: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    if(f=0){
          ^
Main.cc:15:4: error: expected ';' before '}' token
    }else
    ^
Main.cc:17:4: error: expected ';' before 'return'
    return 0;
    ^