Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
47434 石利伟 连续非素数的最长度 C++ Wrong Answer 0 0 MS 244 KB 350 2022-07-14 20:02:32

Tests(0/10):


#include<bits/stdc++.h> using namespace std; int n,ans=0,temp=0,i1=0; bool sushu(int num){ for(int i=2;i<num;i++){ if(num%i==0)return false; } return true; } int main(){ cin>>n; for(int i=1;i<=n;i++){ if(i1+1==i&&sushu(i)==true){ temp++; i1=i; } else temp=0; if(temp>ans)ans=temp; } cout<<ans; return 0; }


Judgement Protocol: