Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <vector>
- using namespace std;
- void wyswietl(vector<int>pokaz)
- {
- for (int x = 0; x < pokaz.size(); x++)
- {
- cout << pokaz[x] << endl;
- }
- }
- int suma(vector<int>sumowanie)
- {
- int y = 0;
- for (int x = 0; x < sumowanie.size(); x++)
- {
- y += sumowanie[x];
- }
- return y;
- }
- int main()
- {
- vector<int>liczby;
- liczby.push_back(39);
- liczby.push_back(30);
- liczby.push_back(31);
- liczby.push_back(33);
- liczby.push_back(32);
- cout << "Wyswietlanie liczb:" << endl;
- wyswietl(liczby);
- int a = suma(liczby);
- cout << "Suma liczb: " << a << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement