4 solutions

  • 1
    @ 2026-8-21 21:05:02
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a,b;
    	cin>>a>>b;
    	int d=0;
    	int c=0;
    	for(int i=a;i<=b;ci++)
    	{
    		c=0;
    		for(int s=2;s<i;s++)
    		{
    			if(i%s==0)
    			{
    				c++;
    			}
    		}
    		if(c==0)
    		{
    			d++;
    		}
    	}
    	cout<<d;
    	return 0;
    }

    Information

    ID
    2535
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    63
    Accepted
    14
    Uploaded By