Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <vector>
- using namespace std;
- int n = 0;
- vector<int> liczby;
- float suma = 0;
- int main()
- {
- cout << "Podaj wielkosc tablicy: ";
- cin >> n;
- liczby.resize(n);
- for (int i = 0; i < n - 1; i++)
- {
- cout << "Podaj " << i + 1 << " liczbe: ";
- cin >> liczby[i];
- suma = suma + liczby[i];
- }
- cout << suma;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement