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 schitaem_sumu_pl_vivod(int a[],int&suma,int n)
- {
- 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 lozh;
- clean_messiv(cards,10);
- while (v == 1)
- {
- summa=0;
- cout<<"Vvedi nomer card: ";
- cin >> nomcards;
- cout<< endl <<"Na skolko popolnit: ";
- cin >> lozh;
- cards[nomcards-1]+=lozh;
- cout<< endl;
- schitaem_sumu_pl_vivod(cards,summa,10);
- }
- }
Add Comment
Please, Sign In to add comment