fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. // zdefiniuj funkcję
  5. bool czy_pierwsza(int i) {
  6. }
  7.  
  8. // zdefiniuj funkcję
  9. int pierwsza(int n) {
  10. int numer =0;
  11. int i=2;
  12. while (numer != n) {
  13. if (czy_pierwsza(1)) numer += 1;
  14. i += 1;
  15. }
  16. return i-1;
  17. }
  18.  
  19. int main() {
  20. // sprawdź działanie funkcji
  21. cout << pierwsza(7) << " " << pierwsza(25) << endl;
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
Standard output is empty