fork(1) download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. program (unsigned short uczestnikow, long pudelko)
  6. {
  7. int doba = 86400, Liczba = 0;
  8. float Ilosc=0;
  9. for (int i=1; i<=uczestnikow; i++)
  10. {
  11. int t = 0;
  12. cout << "podaj czas zjedzenia cistka: ";
  13. cin >> t;
  14. float L = doba/t;
  15. if (doba%t!=0)
  16. L = doba/t - (doba%t);
  17. Liczba = Liczba + L;
  18. }
  19. Ilosc = Liczba/pudelko;
  20. if (Liczba%pudelko!=0)
  21. Ilosc = Liczba/pudelko + (1-(Liczba%pudelko));
  22. return Ilosc;
  23. }
  24.  
  25. int main()
  26. {
  27. unsigned short N;
  28. cout << "Podaj liczbe zestawow danych: ";
  29. cin >> N;
  30. for (int i=1; i<=N; i++)
  31. {
  32. unsigned short uczestnikow = 0;
  33. long pudelko = 0;
  34. cout << "podaj liczbe uczestnikow i liczbe ciastek w pudelku: " << endl;
  35. cin >> uczestnikow >> pudelko;
  36. cout << program(uczestnikow, pudelko) << endl;
  37. }
  38. return 0;
  39. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:5:50: error: ISO C++ forbids declaration of ‘program’ with no type [-fpermissive]
 program (unsigned short uczestnikow, long pudelko)
                                                  ^
stdout
Standard output is empty