Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
129345 罗安博 判断质数(使用while循环) C++ Compile Error 0 MS 0 KB 238 2025-08-24 13:51:48

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ long long n; bool f=true; while(i<=sqrt(n)){ if(n%i==0){ f=false; } } if(f==true){ cout<<"yes"; } else{ cout<<"no"; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:11: error: 'i' was not declared in this scope
     while(i<=sqrt(n)){
           ^