Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- int hugeAmount; //50 doodles
- int largeAmount; //25 doodles
- int mediumAmount; //10 doodles
- int smallAmount; //1 doodle
- int shippedDoodles;
- int temp;
- cout<<"How many doodles were shipped?"<<endl;
- cin>>shippedDoodles;
- temp=shippedDoodles;
- while(temp>0)
- {
- hugeAmount++;
- temp-=50;
- }
- if(temp<0){temp+=50;}
- while(temp>0)
- {
- largeAmount++;
- temp-=25;
- }
- if(temp<0){temp+=25;}
- while(temp>0)
- {
- mediumAmount++;
- temp-=10;
- }
- if(temp<0){temp+=10;}
- while(temp>0)
- {
- smallAmount++;
- temp-=1;
- }
- cout<<temp<<endl;
- cout<<hugeAmount<<endl;
- cout<<largeAmount<<endl;
- cout<<mediumAmount<<endl;
- cout<<smallAmount<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement