1 solutions

  • 1
    @ 2025-3-14 20:24:23
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	int cnt=0;
    	for(int i=2;i<=n;i++)
    	{
    		if(i%10!=7) continue;
    		//判定质数
    		bool st=true;
    		for(int j=2;j<=i/j;j++)
    		{
    			if(i%j==0)
    			{
    				st=false;	
    			}	
    		} 
    		if(st==true) cnt++;
    	}
    	cout<<cnt;
    	return 0;
    }
    
    
    • 1

    Information

    ID
    640
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    3
    Tags
    # Submissions
    64
    Accepted
    25
    Uploaded By