diff --git a/1653_numcutup/Readme.md b/1653_numcutup/Readme.md new file mode 100644 index 0000000..a2afb64 --- /dev/null +++ b/1653_numcutup/Readme.md @@ -0,0 +1,25 @@ +# 整数拆段 + +[问题描述] + +教学案例,必须使用函数完成求解! + +  将一个长度小于15位的数字串拆成2段,使其和为最小的素数。 +  例如数字串‘13304’,拆的方法有: +   1 + 3304 = 3305 +   13 + 304 = 317 +   133 + 04 = 137 +   1330 + 4 = 1334 +  从上面可看出,和为素数的有:317 与137,最小的是137 + +[输入格式] +  一个长度小于15的数字串。 + +[输出格式] +  最小的和为素数的数,若无素数则输出 -1。 + +[输入样例] +13304 + +[输出样例] +137 \ No newline at end of file diff --git a/1653_numcutup/doc/Readme.md b/1653_numcutup/doc/Readme.md new file mode 100644 index 0000000..b4f8d75 --- /dev/null +++ b/1653_numcutup/doc/Readme.md @@ -0,0 +1,3 @@ +# 标题 + +* 内容 \ No newline at end of file diff --git a/1653_numcutup/main.cpp b/1653_numcutup/main.cpp new file mode 100644 index 0000000..f39ad54 --- /dev/null +++ b/1653_numcutup/main.cpp @@ -0,0 +1,6 @@ +#include + +int main() +{ + std::cout << "Hello Easy C++ project!" << std::endl; +} diff --git a/1653_numcutup/main.exe b/1653_numcutup/main.exe new file mode 100644 index 0000000..fc4df42 Binary files /dev/null and b/1653_numcutup/main.exe differ diff --git a/1653_numcutup/numcutup.cpp b/1653_numcutup/numcutup.cpp new file mode 100644 index 0000000..1ca1870 --- /dev/null +++ b/1653_numcutup/numcutup.cpp @@ -0,0 +1,28 @@ +#include +using namespace std; +bool pan(long long n){ + if(n<2){ + return 0; + } + for(int i=2;i*i<=n;i++){ + if(n%i==0){ + return 0; + } + } + return 1; +} +int main(){ + long long n,a=10,b,ans=1000000000000000; + cin>>n; + for(int i=10;a>=10;i*=10){ + a=n/i; + b=n%i; + if(a+b