POJ 2719
#include<iostream>
#include<stdio.h>
using namespace std;
int dight[];
int _pow(int m,int n);
int main(){
//freopen("test.txt","r",stdin);
int i;
int num;
dight[] = ;
dight[] = ;
for(i = ; i < ; i++)
{
dight[i] = _pow(,i-) + dight[i-] + *dight[i-];
}
while(cin>>num){
if(num == )
break;
int j;
int k = ;
int temp;
temp = num;
int sum = ;
while(temp)
{
j = temp%;
temp /= ;
if(j > )
{
sum += _pow(,k);
sum += dight[k]*(j-);
}
else
sum += dight[k]*j;
k++;
}
cout<<num<<": "<<num-sum<<endl;
}
system("pause");
}
int _pow(int m,int n)
{
if(n == )
return ;
else if( == n)
return m;
else
return m*_pow(m,n-);
}
POJ 2719的更多相关文章
- poj 2719 Faulty Odometer
Description You are given a car odometer which displays the miles traveled as an integer. The odomet ...
- 2719:陶陶摘苹果-poj
2719:陶陶摘苹果 总时间限制: 1000ms 内存限制: 65536kB 描述 陶陶家的院子里有一棵苹果树,每到秋天树上就会结出10个苹果.苹果成熟的时候,陶陶就会跑去摘苹果.陶陶有个30厘米 ...
- poj 3373 Changing Digits (DFS + 记忆化剪枝+鸽巢原理思想)
http://poj.org/problem?id=3373 Changing Digits Time Limit: 3000MS Memory Limit: 65536K Total Submi ...
- poj和hdu部分基础算法分类及难度排序
最近想从头开始刷点基础些的题,正好有个网站有关于各大oj的题目分类(http://www.pythontip.com/acm/problemCategory),所以写了点脚本把hdu和poj的一些题目 ...
- 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 ...
随机推荐
- 2018.11.03 NOIP模拟 图(bfs/最短路)
传送门 显然如果AAA到BBB或者CCC到DDD走的不是最短路一定是有一段路径重合了,于是可以O(n2)bfsO(n^2)bfsO(n2)bfs出两点之间的最短距离然后枚举两个点作为重合的端点来更新答 ...
- QT5中无法包含Qtgui头文件的问题。
今天新学QT是,从一个ppt中边看边抄边学.前几页还能理解,但到了用纯源码写空白QT工程时,便遇到了一个问题.头文件里包含 #include <QtGui> 但是编译时总是出现下面图一中 ...
- vue中文章的折叠于显示全部
在以一篇文章中,可能文章特别长,但是在页面第一次显示的时候可能就只需要显示一部分,这种情况下就需要自己进行修改 基本思路 利用类名就是预先定义一个类名,设置高度,和overflow:hidden,前提 ...
- Ng第六课:逻辑回归(Logistic Regression)
6.1 分类问题 6.2 假说表示 6.3 判定边界 6.4 代价函数 6.5 简化的成本函数和梯度下降 6.6 高级优化 6.7 多类分类:一个对所有 6.1 分类问题 在分类问题中 ...
- 用css写出下拉框(代码转自wq群)
做网易云音乐首页时遇到的问题,鼠标指在右上角头像时出现下拉框. <style>/* css*/ #body{ float: left; } #xialakuang{ background- ...
- (多线程dp)Matrix (hdu 2686)
http://acm.hdu.edu.cn/showproblem.php?pid=2686 Problem Description Yifenfei very like play a num ...
- python标准库及其它应用
一: sys模块的介绍: 程序如下: #coding:utf-8import sysprint sys.argv[0]print sys.argv[1]print sys.argv[2] 打开cmd窗 ...
- AngularJs 指令中 的Scope属性
一.概念说明 可以是true. false .哈希对象 {} 1.true 新创建了一个作用域,且继承了父作用域:在初始化的时候,用了父作用域的属性和方法去填充我们这个新的作用域.它和父作用域不是同一 ...
- 为什么有时候在mac中启动一些应用时会跳的Windows中
因为有些格式是尽在windows情况下才支持的,如果mac上安装了虚拟的Windows,则执行此类应用(例如:.bat 文件)时就会启动Windows虚机
- [leet code 165]Compare Version Numbers
1 题目 Compare two version numbers version1 and version2.If version1 > version2 return 1, if versio ...