1 条题解

  • 0
    @ 2025-1-25 15:22:11

    #include<bits/stdc++.h>
    using namespace std;
    bool ps(int a){
    	if(a==1||a==0){
    		return false; 
    	}
    	for(int i=2;i<=sqrt(a);i++){
    		if(a%i==0){
    			return false; 
    		}
    	}
    	return true;
    }
    bool pswshw(int d){
    	if(d%10==d/100){
    		return true;
    	}
    	return false;
    }
    int main(){
    	int a1;
    	for(int i=100;i<=999;i++){
    		if(ps(i)&&pswshw(i)){
    			cout<<i<<"\n";
    		}
    	}
    	return 0;
    }
    
    
    • 1

    信息

    ID
    917
    时间
    1000ms
    内存
    128MiB
    难度
    6
    标签
    (无)
    递交数
    24
    已通过
    12
    上传者