Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int i, amount;
  8.     int cards[10];
  9.  
  10.     for(i=0; i < 10; i++){
  11.         cards[i]=0;
  12.         cout << cards[i] << " ";
  13.     }
  14.  
  15.     cout << endl << endl;
  16.  
  17.     while (0 < 1 || i >= 0){
  18.         do{
  19.             cout << "Input please a number of a card you would like to replenish: ";
  20.             cin >> i;
  21.  
  22.         }while (i > 10 || i < 0 );
  23.  
  24.         cout << endl;
  25.  
  26.         cout << "Input please amount of money: ";
  27.         cin >> amount;
  28.  
  29.         cards[i-1] += amount;
  30.  
  31.         i = 0;
  32.  
  33.         for(i=0; i < 10; i++){
  34.             cout << cards[i] << " ";
  35.         }
  36.         cout << endl << endl;
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement