Advertisement
mostlabs

1212

Feb 26th, 2020
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include<iostream>
  2. #include<cmath>
  3.  
  4. using namespace std;
  5. void kal1(int *u, int n) {
  6.  
  7. float* mas = new float[n];
  8.  
  9. for (int i = 0; i < n; i++) {
  10. cin >> mas[i];
  11. *u *= mas[i];
  12. }
  13.  
  14. }
  15. void kal2(int *v, int m) {
  16.  
  17. float* mas = new float[m];
  18.  
  19. for (int i = 0; i < m; i++) {
  20. cin >> mas[i];
  21. *v *= mas[i];
  22. }
  23. }
  24.  
  25. int main()
  26. {
  27. int u = 1, v = 1;
  28.  
  29. int n, m;
  30.  
  31.  
  32. cout << "n:";
  33. cin >> n;
  34.  
  35. cout << "m:";
  36. cin >> m;
  37.  
  38. kal1(&u,n);
  39. kal2(&v,m);
  40. cout << pow(u,1.0/m)-pow(v,1.0/n);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement