POJ 2551
#include<iostream>
#include<stdio.h>
#include<string>
using namespace std; //int my_pow(int ,int );
int main()
{
//freopen("acm.acm","r",stdin);
int s;
int i;
int num;
while(cin>>s)
{
num = ;
for(i = ; ; ++ i)
{
num = num* + ;
if(num % s == )
{
cout<<i+<<endl;
break;
}
else
{
num %= s;
}
}
//cout<<num<<endl; }
}
/*int my_pow(int a,int b)
{
if(b == 0)
return 1;
else
{
return a*my_pow(a,b - 1);
}
}*/
POJ 2551的更多相关文章
- poj 2551 Ones
本题的想法很简单,就是模拟手算乘法.不一样的是,需要控制输出的结果:每一位都是由1构成的整数. 代码如下: #include <iostream> using namespace std; ...
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
- POJ 2255. Tree Recovery
Tree Recovery Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11939 Accepted: 7493 De ...
- POJ 2752 Seek the Name, Seek the Fame [kmp]
Seek the Name, Seek the Fame Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17898 Ac ...
随机推荐
- hashCode() 和equals() 区别和作用(转)
出处:https://www.jianshu.com/p/5a7f5f786b75 本章的内容主要解决下面几个问题: 1 equals() 的作用是什么? 2 equals() 与 == 的区别是什么 ...
- Le Chapitre IV
J'avais ainsi appris une seconde chose très importante: C'est que sa planète d'origine était à peine ...
- mysql重装之后 复制data
(哇,编程小白的第一篇博客丫,激动) Q one:mysql需要重装,数据该怎么办. 方法一:数据表最好是导出成.sql文件,这样才比较安全. 方法二:直接copy了data文件:在mysql安装盘下 ...
- 第12章:MongoDB-CRUD操作--文档--查询--游标详解
①是什么游标 游标不是查询结果,可以理解为数据在遍历过程中的内部指针,其返回的是一个资源,或者说数据读取接口. 客户端通过对游标进行一些设置就能对查询结果进行有效地控制,如可以限制查询得到的结果数量. ...
- hadoop Hive 的建表 和导入导出及索引视图
1.hive 的导入导出 1.1 hive的常见数据导入方法 1.1.1 从本地系统中导入数据到hive表 1.创建student表 [ROW FORMAT DELIMITED]关键字,是用来设 ...
- 小组spring计划列表
我们的会议地点:石家庄铁道大学三栋420. 每天进行会议的时间是早上七点钟. 会议内容:主要是讨论当日进行哪一个进程.
- Visual Studio 2017快捷键
作者:tongqingliu 转载请注明出处:http://www.cnblogs.com/liutongqing/p/7048639.html Visual Studio 2017快捷键 Ctrl+ ...
- Windows网络编程(C/C++服务器编程)
Windows服务器网络编程 Linux服务器网络编程
- 绑定弹窗事件最好的方法,原生JS和JQuery方法
使用jQuery ui = { $close: $('.close') , $pop: $('.pop') , $topopBtn: $('.topop-btn') , $popbtnArea: $( ...
- HDU 2057 十六进制加减法
http://acm.hdu.edu.cn/showproblem.php?pid=2057 水题,%I64X 长整形十六进制输入输出 #include<stdio.h> in ...