1 solutions

  • 0
    @ 2026-4-25 18:48:56
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a,b;
    	cin>>a>>b;
    	int cnt=0;
    	for(int i=a;i<=b;i++)
    	{
    		int c=0;
    		for(int j=1;j<=i;j++)
    		{
    			if(i%j==0)
    			{
    				c++;
    			}
    		}
    		if(c==2)
    		{
    			cnt++;
    		}
    	}
    	cout<<cnt;
    	return 0;
    }
    
    
    • 1

    Information

    ID
    1163
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    # Submissions
    85
    Accepted
    24
    Uploaded By