Advertisement
AndriikoM

Лекція 3, завдання 2

Oct 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7.     int a[10];
  8.     int b;
  9.     int d;
  10.     for (int i=0; i<10; i++)
  11.     {
  12.         a[i]=0;
  13.     }
  14.     while (1)
  15.     {
  16.         cout << "vvedite nomer carti ";
  17.         cin >> b;
  18.         cout << "vvedite sumy ";
  19.         cin >> d;
  20.         a[b]=a[b]+d;
  21.         for (int i=0; i<10; i++)
  22.             {
  23.                 cout << a[i] << " ";
  24.             }
  25.         cout << endl;
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement