Compare commits

..

No commits in common. "74378a705df331d748af332a4a74a18775a6a5a7" and "27c9072f380bfbfd389abf9b848b439e53f1717f" have entirely different histories.

14 changed files with 7 additions and 155 deletions

View File

@ -1,20 +0,0 @@
# 回文素数的个数
[问题描述]
教学案例,必须使用函数完成求解!
  如果一个数从左边读和从右边读都是同一个数就称为回文数。例如6886就是一个回文数从给出的数据中统计出既是回文数又是素数的数的个数。
[输入格式]
  若干行,每行有若干个整数(待检测所有整数总个数 <= 10^5 0 < 每个整数的值 < 10^9
[输出格式]
  一个整数,即回文素数的个数。
[输入样例]
7 12 10 11 121 1331 10301
[输出样例]
3

View File

@ -1,3 +0,0 @@
# 标题
* 内容

View File

@ -1,6 +0,0 @@
#include <iostream>
int main()
{
std::cout << "Hello Easy C++ project!" << std::endl;
}

Binary file not shown.

View File

@ -1,39 +0,0 @@
#include <cstring>
#include <iostream>
using namespace std;
int sushu(int n)
{
if(n==1){
return 0;
}
for (int i = 2; i * i <= n; i++) {
if (n % i == 0) {
return 0;
}
}
return 1;
}
int huiwen(string n)
{
int len = n.size() - 1;
for (int i = 0; i <= len / 2; i++) {
if (n[i] != n[len - i]) {
return 0;
}
}
int s = 0;
for (int i = n.size() - 1; i >= 0; i--) {
s *= 10;
s += n[i]-'0';
}
return sushu(s);
}
int main()
{
int ans = 0;
string n;
while (cin >> n) {
ans += huiwen(n);
}
cout<<ans;
}

View File

@ -1 +0,0 @@
7 12 10 11 121 1331 10301

View File

@ -1,6 +0,0 @@
## z:\Chao\src\1567_numofsamesushu\test\in.txt
2020/03/14 ÖÜÁù 23:11:10.92
3
-----------------------------------------------
Process exited after 350 ms with return value 0

View File

@ -1,50 +1,5 @@
#include <iostream>
#include<iostream>
using namespace std;
bool a[51][51] = { 0 };
int bi(int x, int y)
{
a[x][y] = 1;
if (a[x - 1][y] == 0){
a[x-1][y]=1;
return 1;
}
if (a[x][y - 1] == 0){
a[x][y-1]=1;
return 1;
}
a[x][y] = 0;
return 0;
}
int main()
{
int m, n, k, ans = 0;
cin >> m >> n >> k;
for (int i = 1; i <= k; i++) {
int x, y;
cin >> x >> y;
a[x][y] = 1;
}
for (int i = 0; i <= n; i++) {
a[0][i] = 1;
}
for (int i = 1; i <= m; i++) {
a[i][0] = 1;
}
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++) {
if (a[i][j] !=1) {
ans += bi(i, j);
}/*
cout<<ans<<endl;
for (int u = 0; u <= m; u++) {
for (int e = 0; e <= n; e++) {
cout << a[u][e] << " ";
}
cout << endl;
}
cout << endl
<< endl;*/
}
}
cout << ans;
int main(){
}

Binary file not shown.

View File

@ -1,3 +0,0 @@
1 4
1
1 2

View File

@ -1,10 +0,0 @@
1 47
8
1 5
1 6
1 12
1 23
1 25
1 28
1 41
1 46

View File

@ -1,4 +0,0 @@
3 3
2
1 1
2 2

View File

@ -1,18 +1,7 @@
## z:\Chao\src\2016_domino\test\in.txt
2020-03-14 20:05:54.27
3
-----------------------------------------------
Process exited after 340 ms with return value 0
## z:\Chao\src\Template\test\in.txt
2020/03/14 ÖÜÁù 11:41:28.68
Hello Easy C++ project!
## z:\Chao\src\2016_domino\test\In0.txt
2020-03-14 20:05:54.27
1
-----------------------------------------------
Process exited after 230 ms with return value 0
## z:\Chao\src\2016_domino\test\In1.txt
2020-03-14 20:05:54.27
18
-----------------------------------------------
Process exited after 210 ms with return value 0
Process exited after 200 ms with return value 0