fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n,i,j,k,l,teste;
  6. cin>>n;
  7. teste=1;
  8. while(n!=0){
  9. cout<<"Teste "<<teste<<endl;
  10. while(n!=0){
  11. if(n>=50){
  12. i++;
  13. n=n-50;
  14. }
  15. if ((n<50) && (n>=10)){
  16. j++;
  17. n=n-10;
  18. }
  19. if ((n<10) && (n>=5)){
  20. k++;
  21. n=n-5;
  22. }
  23. if ((n<5) && (n>=1)){
  24. l++;
  25. n=n-1;
  26. }
  27. }
  28. cout<<i<<" ";
  29. cout<<j<<" ";
  30. cout<<k<<" ";
  31. cout<<l<<endl<<endl;
  32.  
  33.  
  34. i=0;
  35. j=0;
  36. k=0;
  37. l=0;
  38. teste++;
  39. cin>>n;
  40. }
  41. return 0;
  42. }
Success #stdin #stdout 0s 3472KB
stdin
1 
72
0
stdout
Teste 1
0 0 0 1

Teste 2
1 2 0 2