Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int main()
  5. {
  6. int t, o, c, d = 86400;
  7. float czas[100000];
  8. float suma = 0, wynik = 0;
  9. cout << "Podaj liczbe testow : ";
  10. cin >> t;
  11. for (int i = 0; i < t; i++)
  12. {
  13. cout << "Podaj liczbe obzartuchow i ciastek : ";
  14. cin >> o >> c;
  15. for (int j = 0; j < o; j++)
  16. {
  17. cout << "Podaj czas jedzenia ciastka : ";
  18. cin >> czas[j];
  19. czas[j] = floor (((float) d)/czas[j]);
  20. suma = suma + czas[j];
  21. wynik = ceil(suma/c);
  22. }
  23. cout << "Liczba pudelek : " << wynik << endl;
  24. }
  25.  
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement