Results 1 to 5 of 5

Thread: C.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User demonskater's Avatar
    Join Date: Sep:2009
    Location: Varna
    Posts: 103

    C.

    !

    , , :

    " N , N. , N."
    ? , .
    .
    , .

  2. #2
    Registered User
    Join Date: Oct:2003
    Location:
    Posts: 4,317
    5. :
    1 1 1 1 1
    1 1 1 2
    1 1 3
    1 4
    1 2 2
    1 3 1
    2 3

    , . N (N-1,1).

  3. #3
    Registered User demonskater's Avatar
    Join Date: Sep:2009
    Location: Varna
    Posts: 103
    , .

    ---------- 21:09 ---------- 21:00 ----------

    Code:
    #include <iostream>
    using namespace std;
    
    int coin[]={9,8,7,6,5,4,3,2,1};
    
    void nom(int sum, int i)
    {
    	if(i>8)
    		return;
    	int res=sum/coin[i];
    	int s1=sum%coin[i];
    	
    	if(res>0)
    		cout<<" "<<res<<"*"<<coin[i];
    	
    	
    	nom(s1, i+1);
    	
    }
    
    
    void main()
    {
    	int sum;
    	cout<<"\n Vuvedi syma: ";
    	cin>>sum;
    	nom(sum,0);
    	cout<<endl<<endl;
    }
    . ?
    , .

  4. #4
    Registered User
    Join Date: Dec:2007
    Location: Sofia
    Posts: 366
    , .

    bsb?

  5. #5
    Registered User Tuchkata's Avatar
    Join Date: Oct:2007
    Location: Sofia
    Posts: 165
    Greedy ?
    LONG LIVE OPEN SOURCE !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |