#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的更多相关文章

  1. poj 2551 Ones

    本题的想法很简单,就是模拟手算乘法.不一样的是,需要控制输出的结果:每一位都是由1构成的整数. 代码如下: #include <iostream> using namespace std; ...

  2. POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理

    Halloween treats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7644   Accepted: 2798 ...

  3. POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理

    Find a multiple Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7192   Accepted: 3138   ...

  4. POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治

    The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286 ...

  5. POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法

    Flip Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37427   Accepted: 16288 Descr ...

  6. POJ 3254. Corn Fields 状态压缩DP (入门级)

    Corn Fields Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 9806   Accepted: 5185 Descr ...

  7. POJ 2739. Sum of Consecutive Prime Numbers

    Sum of Consecutive Prime Numbers Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 20050 ...

  8. POJ 2255. Tree Recovery

    Tree Recovery Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11939   Accepted: 7493 De ...

  9. 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 ...

随机推荐

  1. 百度地图足迹demo(多点轨迹生成)

    不要忘记引用JQuery//~~~<script src="jquery-1.7.1.min.js" type="text/javascript"> ...

  2. 在vue或者react中使用express框架

    在react 或者 vue项目中使用express框架 1.创建vue或者 react 项目 2.在项目中创建server文件夹,创建server.js //require()方法引入express模 ...

  3. (10)The secret to great opportunities? The person you haven't met yet

    https://www.ted.com/talks/tanya_menon_the_secret_to_great_opportunities_the_person_you_haven_t_met_y ...

  4. hadoop学习笔记-目录

    以下是hadoop学习笔记的顺序: hadoop学习笔记(一):概念和组成 hadoop学习笔记(二):centos7三节点安装hadoop2.7.0 hadoop学习笔记(三):hdfs体系结构和读 ...

  5. c++关键字volatile的作用

    1.易变性 1.1概念 编译器对volatile修饰的变量,当要读取这个变量时,任何情况下都会从内存中读取,而不会从寄存器缓存中读取(因为每次都从内存中读取体现出变量的“易变”) 1.2测试代码(VS ...

  6. CDATASection类型——数据采集

    CDATASection类型只针对基于XML的文档,表示的是CDATA区域 CDATASection类型和comment类型都是继承自基于Text类型,除了splitText()之外的所有字符串方法 ...

  7. 上传文件夹+php

    最近公司做工程项目,实现文件夹上传 网上找了很久,发现网上很多代码大都存在很多问题,不过还是让我找到了一个符合要求的项目. 对项目的文件夹上传功能做出分析,找出文件夹上传的原理,对文件夹的传输模式深入 ...

  8. Ng第十六课:推荐系统(Recommender Systems)

    16.1  问题形式化 16.2  基于内容的推荐系统 16.3  协同过滤 16.4  协同过滤算法 16.5  矢量化:低秩矩阵分解 16.6  推行工作上的细节:均值归一化 16.1  问题形式 ...

  9. (转)MYSQL远程登录权限设置

    转自:http://blog.csdn.net/zhengnz/article/details/6308773 Mysql默认关闭远程登录权限,如下操作允许用户在任意地点登录: 1. 进入mysql, ...

  10. (转)EntityFramework.Extensions

    转自:http://www.symbolsource.org/Public/Metadata/NuGet/Project/EntityFramework.Extended/1.0.0.20/Relea ...