Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. int proby;
  9. cout << "Proby" << endl;
  10. cin >> proby;
  11.  
  12. int *obzartuchy = new int[proby];
  13. float *w_pudelku = new float[proby];
  14. float *suma = new float[proby];
  15.  
  16. for (int i = 0; i < proby; i++)
  17. {
  18. cout << "obzartuchy w " << i + 1 << endl;
  19. cin >> obzartuchy[i];
  20. cout << "ciastka do pudelka w " << i + 1 << endl;
  21. cin >> w_pudelku[i];
  22. float *czasy = new float[obzartuchy[i]];
  23. for (int j = 0; j < obzartuchy[i]; j++)
  24. {
  25. cout << "czas dla" << i + 1 << "przypadku" << " " << j + 1 << " elementu" << endl;
  26. cin >> czasy[j];
  27. suma[i] += floor(86400.0 / czasy[j]);
  28.  
  29. }
  30. cout << "SUMA[i]==" << suma[i] << endl;
  31.  
  32. }
  33. system("pause");
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement