Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1.  
  2.  
  3. #include <iostream>
  4. #include <fstream>
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int hugeAmount; //50 doodles
  10. int largeAmount; //25 doodles
  11. int mediumAmount; //10 doodles
  12. int smallAmount; //1 doodle
  13. int shippedDoodles;
  14. int temp;
  15. cout<<"How many doodles were shipped?"<<endl;
  16. cin>>shippedDoodles;
  17. temp=shippedDoodles;
  18. while(temp>0)
  19. {
  20. hugeAmount++;
  21. temp-=50;
  22. }
  23. if(temp<0){temp+=50;}
  24. while(temp>0)
  25. {
  26. largeAmount++;
  27. temp-=25;
  28. }
  29. if(temp<0){temp+=25;}
  30. while(temp>0)
  31. {
  32. mediumAmount++;
  33. temp-=10;
  34. }
  35. if(temp<0){temp+=10;}
  36. while(temp>0)
  37. {
  38. smallAmount++;
  39. temp-=1;
  40. }
  41. cout<<temp<<endl;
  42. cout<<hugeAmount<<endl;
  43. cout<<largeAmount<<endl;
  44. cout<<mediumAmount<<endl;
  45. cout<<smallAmount<<endl;
  46. system("pause");
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement