Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void clean_messiv(int a[],int n)
- {
- for (int i=0;i<n;i++)
- a[i]=0;
- }
- void vivod_sumu(int a[],int n)
- {
- int suma=0;
- for (int i=0;i<n;i++)
- {
- suma+=a[i];
- cout << a[i] << " ";
- }
- cout<< endl<< "V sume na vseh cards: ";
- cout<< suma << endl;
- }
- int main()
- {
- int cards[10];
- int v = 1;
- int summa;
- int nomcards;
- int polozh;
- clean_messiv(cards,10);
- while (v == 1)
- {
- summa=0;
- cout<<"Vvedi nomer card: ";
- cin >> nomcards;
- cout<< endl <<"Na skolko popolnit: ";
- cin >> polozh;
- cards[nomcards-1]+=polozh;
- cout<< endl;
- vivod_sumu(cards,10);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement