Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
47439 石利伟 奇怪的车牌号 C++ 解答错误 0 0 MS 248 KB 343 2022-07-14 20:25:01

Tests(0/1):


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


测评信息:

输入

0

输出

0

答案

9

系统信息

exit code: 0, checker exit code: 0