count character input using a single variable : 1) I'm trying to count the input of characters, for example: 1 1 1 1 1 2 2 2 2 5 5 5 5 5 5 10 10 10, but I can not get rid of the loop and start a new countdown.

2) When I try to record only the total number of cents on the screen, cout is always repeated in each cycle, how can I get only the whole amount at the end of the cycle?

3) How can I change my code to simplify the calculation of numbers?

Any suggestions?


    int main(){
    int cent = 0;
    int cent_input = 0;
    int cent_quantity = 0;
    int downgrade_to_one = 0;
    
    do{
    while(true){
    cout << "\nEnter number: " && cin >> cent;
    switch(cent){
    case 1:
    downgrade_to_one =  cent + downgrade_to_one;
    if(cent == 0)
    cent + 1;
    cout << "\nYou have: " << downgrade_to_one << " one cent monets.";
    break;
    case 2:
    cent_input = (cent_input + cent) / cent;
    cent_quantity = cent_quantity + cent_input;
    cout << "\nYou have: " << cent_quantity << " two cent monets.";
    case 5:
    cent_input = (cent_input + cent) / cent;
    cent_quantity = cent_quantity + cent_input;
    cout << "\nYou have: " << cent_quantity << " five cent monets.";
    break;
    case 10:
    cent_input = (cent_input + cent) / cent;
    cent_quantity = cent_quantity + cent_input;
    cout << "\nYou have: " << cent_quantity << " ten cent monets.";
    break;
    case 25:
    cent_input = (cent_input + cent) / cent;
    cent_quantity = cent_quantity + cent_input;
    cout << "\nYou have: " << cent_quantity << " twentyfive cent monets.";
    break;
    case 50:
    cent_input = (cent_input + cent) / cent;
    cent_quantity = cent_quantity + cent_input;
    cout << "\nYou have: " << cent_quantity << " fifty cent monets.";
    break;
    default:
    cout << "\nUndefined input!";
       }
      }
     }
    while(false);
    }