1 solutions

  • 1
    @ 2025-11-2 15:02:38
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	for(int x=0;x<=n;x++){
    		for(int y=0;y<=n;y++){
    			for(int z=0;z<=n;z++){
    				if(x+y+z<=n){
    					cout<<x<<" "<<y<<" "<<z<<endl;
    				}
    			}
    		}
    	}
    	return 0;
    }
    
    
    

    Information

    ID
    2644
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    # Submissions
    20
    Accepted
    14
    Uploaded By