1 solutions

  • 0
    @ 2025-11-5 15:13:20

    C++ :

    #include<cmath>
    #include<iostream>
    using namespace std;
    int main()
    {
    	int i,t=0;
    	bool a[10];
    	for (i=0;i<10;++i) a[i]=true;
    	i=0;
    	for (int j=1;j<=1000;++j)
    	{
    		i=(i+j-1) %10;
    		a[i]=false;
    	}
    	for (i=0;i<10;i++)
    		if (a[i]) {
    			t++;
    			if (t==1) cout<<i;
    				else cout<<" "<<i;
    		}
    	cout<<endl;
    	return 0;    
    }
    
    
    • 1

    Information

    ID
    16534
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By