博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
寻找符合条件的整数
阅读量:7055 次
发布时间:2019-06-28

本文共 904 字,大约阅读时间需要 3 分钟。

任意一个整正数N,求一个最小的正整数M(M>1),使得M*N的十进制表示形式只包含1和0

 

1 #include 
2 #include
3 #include
4 5 using namespace std; 6 7 int main() 8 { 9 long long M,N;10 N=99;11 long long reminder[N];12 int i,j,k;13 int noUpdates=0;14 for(i=0; i
033 && X > reminder[k]34 && reminder[(k+j)%N] ==0)35 {36 flag=true;37 reminder[(k+j)%N] = X+reminder[k];38 }39 }40 if(flag=false)41 {42 noUpdates++;43 }44 else45 {46 noUpdates=0;47 }48 if(noUpdates == N || reminder[0]>0)49 {50 break;51 }52 }53 if(reminder[0]==0)54 {55 cout<<"no rlt"<

转载于:https://www.cnblogs.com/eric-blog/archive/2012/08/08/2628628.html

你可能感兴趣的文章
变量提升
查看>>
读写文件
查看>>
Spring Tool Suite (STS)使用Spring Template Project 生成项目时报错解决方法
查看>>
apache性能优化
查看>>
apache伪静态设置
查看>>
MathType手写输入面板清空的方法
查看>>
专注Jquery
查看>>
CSS之flex兼容
查看>>
《APUE》读书笔记—第四章文件和目录
查看>>
10分钟精通SharePoint - SharePoint定位
查看>>
密码应用技术系列之0:开篇
查看>>
cat、head、tail、more和less命令(文件内容浏览)
查看>>
SpringMVC (八)SpringMVC返回值类型
查看>>
poj1190生日蛋糕--DFS
查看>>
多线程-synchronized
查看>>
2018.03.28
查看>>
cc笔记_web测试方法总结
查看>>
Exchange企业实战技巧(18)日志规则应用之审计邮箱
查看>>
sharepoint 2010 同步问题
查看>>
iftop流量监控使用
查看>>