diff --git a/GESP/GESP C++二级认证试卷2023年6月.pdf b/GESP/GESP C++二级认证试卷2023年6月.pdf index b4ce476..11b0629 100644 Binary files a/GESP/GESP C++二级认证试卷2023年6月.pdf and b/GESP/GESP C++二级认证试卷2023年6月.pdf differ diff --git a/GESP/Test.cpp b/GESP/Test.cpp new file mode 100644 index 0000000..1f79dc8 --- /dev/null +++ b/GESP/Test.cpp @@ -0,0 +1,18 @@ +#include +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; +} \ No newline at end of file diff --git a/GESP/新文件1.cpp b/GESP/新文件1.cpp deleted file mode 100644 index 9248b3d..0000000 --- a/GESP/新文件1.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include -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; -} \ No newline at end of file