parent
be907d1475
commit
fc335754a9
Binary file not shown.
@ -0,0 +1,18 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int cnt;
|
||||||
|
bool isPrime(int x) {
|
||||||
|
for (int i = 2; i <= sqrt(x); i++)
|
||||||
|
if (x % i == 0) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
int main() {
|
||||||
|
int n, m;
|
||||||
|
cin >> n >> m;
|
||||||
|
for (int i = n; i <= m; i++)
|
||||||
|
if (isPrime(i)) cnt++;
|
||||||
|
|
||||||
|
cout << cnt << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
@ -1,19 +0,0 @@
|
|||||||
#include <bits/stdc++.h>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
int n;
|
|
||||||
cin >> n;
|
|
||||||
for (int i = 1; i <= n; i++) {
|
|
||||||
for (int j = 1; j <= n; j++) {
|
|
||||||
if (j == 1 || j == n)
|
|
||||||
cout << "|";
|
|
||||||
else if (i == n / 2 + 1)
|
|
||||||
cout << "-";
|
|
||||||
else
|
|
||||||
cout << "a";
|
|
||||||
}
|
|
||||||
puts("");
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
Loading…
Reference in new issue