Advertisement
Guest User

Untitled

a guest
Dec 16th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int c,x;
  9. long long suma=0;
  10. cout << "Podaj kwote: " << endl;
  11. cin>> x;
  12. cout<<"Podaj liczbe kategotij: ";
  13. cin>>c;
  14. int * a = new int[c];
  15.  
  16. for(int i=0; i<c; i++){
  17. cout << "Podaj ilosc kupcow w kategorii " << i+1 << endl;
  18. cin>> a[i];
  19. suma = suma + a[i]*pow(x,a[i])-(a[i]*x);
  20. }
  21.  
  22.  
  23. cout<<" Zysk z wszystkich kupcow: "<< suma ;
  24.  
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement