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 ...
随机推荐
- PHP中奖概率实现
$prize_arr = array( '0' => array('id'=>1,'prize'=>'elm_1','rate'=>1), '1' => array('i ...
- 第15章 上下文管理器和else块
#<流流畅的Python>第15章 上下文管理器和else块 #15.1 先做这个,再做那个:if语句之外的else块 #else子句不仅能在if语句中使用,还能在for.while和tr ...
- boost--signal
1.signals2库 signals2库实现了线程安全的观察者模式,在signals2中观察者模式被称为信号/插槽(signals/slots),它是一种函数回调机制.一个信号可以关联一个或多个插槽 ...
- python模块:sys
# encoding: utf-8 # module sys # from (built-in) # by generator 1.145 """ This module ...
- Mybatis-Plus 实战完整学习笔记(十)------条件构造器核心用法大全(下)
31.升序orderByAsc 31.升序orderByAsc List<Employee> employeeList = employeeMapper.selectList(new Qu ...
- IntelliJ IDEA 2017版 spring-boot2.0.2 搭建 JPA springboot DataSource JPA 实体类浅谈
一.实体类分析 一般用到的实体类的类型有 String类型.Long类型.Integer类型.Double类型.Date类型.DateTime类型.Text类型.Boolean型等 1.String类 ...
- IntellJ IDEA 对于 Spring Boot2.0.2 配置文件application.properties 配置
1.指定文件名称: 打开IDEA编辑位置: 找到如图位置: 点开后方设置 设置输入如下内容:(默认的配置文件名字可以使用--spring.config.name来指定,只需要指定文件的名字,文件扩展名 ...
- 使用Expression tree访问类的属性名称与值
表达式树Expression是Linq中一项比较重要的功能,对其深刻了解Lamda以及计算表达式有很大的帮助. 下面是利用 Expression<Func<Object>>[] ...
- Java EE Servlet 几个path
ContextPath Context ['kɒntekst] 不识庐山真面目,只缘身在此山中. 相对路径 RealPath 绝对路径 ServletPath 就是servlet-mapping 中 ...
- Write Markdown Syntax Online Document with Sphinx and Pandoc
There is no doubt that we have to write doc while we are developing software. But How do you write d ...