Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- using namespace std;
- void wczyt(int *wsk, int a)
- {
- for (int i=0;i<a;i++)
- {
- cout<<"Podaj liczbe"<<endl;
- cin>>*wsk;
- wsk++;
- }
- }
- void wyp(int *wsk, int a)
- {
- for (int i=0;i<a;i++)
- {
- cout<<"Liczba to:"<<*wsk<<endl;
- wsk++;
- }
- }
- void suma(int *wsk,int a,int b, int c)
- {
- for (int i=0;i<a;i++)
- {
- b=*wsk+b;
- c=*wsk*c;
- wsk++;
- }
- cout<<"Suma to:"<<b<<" a iloczyn:"<<c<<endl;
- }
- int main()
- {
- int a,b,c;
- b=0;
- c=1;
- int tab[100];
- int *wsk=tab;
- cout<<"Ile liczb chcesz wczytac?"<<endl;
- cin>>a;
- wczyt(wsk,a);
- wsk=tab;
- wyp(wsk,a);
- wsk=tab;
- suma(wsk,a,b,c);
- cin.get();
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement