Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int c,x;
- long long suma=0;
- cout << "Podaj kwote: " << endl;
- cin>> x;
- cout<<"Podaj liczbe kategotij: ";
- cin>>c;
- int * a = new int[c];
- for(int i=0; i<c; i++){
- cout << "Podaj ilosc kupcow w kategorii " << i+1 << endl;
- cin>> a[i];
- suma = suma + a[i]*pow(x,a[i])-(a[i]*x);
- }
- cout<<" Zysk z wszystkich kupcow: "<< suma ;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement