Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int primo(int i) {
- int i_copia=i;
- while (i >=2 and i<=i-1) {
- if (i_copia % i == 0) {
- return false;
- }
- }
- return true;
- }
- int main() {
- int n, j=0,k;
- cin >> n;
- int array[n];
- cout << primo(57);
- for (int i=2; i<=n;i++) {
- if (primo(i) == true or double(sqrt(i))-int(sqrt(i))==0) {
- i = array[j];
- j += 1;
- }
- }
- cout << k << endl;
- for (int i=0;i<k;i++) {
- cout << array[i];
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement