Advertisement
Guest User

Untitled

a guest
Apr 19th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int primo(int i) {
  5. int i_copia=i;
  6. while (i >=2 and i<=i-1) {
  7. if (i_copia % i == 0) {
  8. return false;
  9. }
  10. }
  11. return true;
  12.  
  13. }
  14.  
  15. int main() {
  16. int n, j=0,k;
  17. cin >> n;
  18. int array[n];
  19. cout << primo(57);
  20.  
  21. for (int i=2; i<=n;i++) {
  22. if (primo(i) == true or double(sqrt(i))-int(sqrt(i))==0) {
  23. i = array[j];
  24. j += 1;
  25. }
  26. }
  27.  
  28. cout << k << endl;
  29. for (int i=0;i<k;i++) {
  30. cout << array[i];
  31. }
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement