新手求助!!!1个AC,1个WA,其它TLE。
查看原帖
新手求助!!!1个AC,1个WA,其它TLE。
738212
chanthu2114楼主2022/7/27 13:59
#include<cstdio>
using namespace std;
int main(){
    int N;
    scanf("%d",&N);
    int i,j,priN;
    priN = 1;
    for(i=2;i<=N;i++){
        for(j=2;j<=(i-1);j++){
        	if (i%j==0){
				break;
			}
			else if (j==(i-1)){
				printf("%d",i);
				priN=priN+1;	
			}
        } 
    }
    printf("%d",priN);
    return 0;
}
2022/7/27 13:59
加载中...