Facebook
From Innocent Stork, 1 Year ago, written in Plain Text.
This paste is a reply to Untitled from Rude Octupus - view diff
Embed
Download Paste or View Raw
Hits: 248
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int S, t1, t2, t3, nt1=0, nt2=0, nt3=0 ;
  8.  
  9.     cout << "Introduceti suma de bani, urmata de valorile celor trei monede" << endl;
  10.  
  11.     cin >> S >> t1 >> t2 >> t3 ;
  12.  
  13.  
  14.     while ( S >= t1 )
  15.     {
  16.         S = S-t1 ;
  17.         nt1++ ;
  18.     }
  19.     while ( S >= t2 )
  20.     {
  21.         S = S-t2 ;
  22.         nt2++ ;
  23.     }
  24.     while ( S >= t3 )
  25.     {
  26.         S = S-t3 ;
  27.         nt3++ ;
  28.     }
  29.  
  30.     cout << endl << nt1 << " monede de " << t1 << endl;
  31.  
  32.     cout << endl << nt2 << " monede de " << t2 << endl;
  33.  
  34.     cout << endl << nt3 << " monede de " << t3 << endl;
  35.  
  36.     return 0;
  37. }
  38.  

Replies to Re: Untitled rss

Title Name Language When
Re: Re: Untitled Sweltering Guinea Pig text 1 Year ago.