1 solutions

  • 0
    @ 2026-3-25 18:44:50
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	int cnt=0;
    	for(int x=1;x<=n;x++)
    	{
    		int cnt1=0,cnt2=0;
    		int t=x;
    		while(t)
    		{
    			int ge=t%10;
    			if(ge==7) cnt1++;
    			t/=10;
    		}
    		t=x;
    		while(t)
    		{
    			int ge=t%8;
    			if(ge==7) cnt2++;
    			t/=8;
    		}
    		if(cnt1==0&&cnt2==0)
    		{
    			cnt++;
    		}
    	}
    	cout<<cnt;
    	return 0;
    }
    
    
    • 1

    Information

    ID
    2715
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    # Submissions
    11
    Accepted
    6
    Uploaded By