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

  1. poj 2719 Faulty Odometer

    Description You are given a car odometer which displays the miles traveled as an integer. The odomet ...

  2. 2719:陶陶摘苹果-poj

    2719:陶陶摘苹果 总时间限制:  1000ms 内存限制:  65536kB 描述 陶陶家的院子里有一棵苹果树,每到秋天树上就会结出10个苹果.苹果成熟的时候,陶陶就会跑去摘苹果.陶陶有个30厘米 ...

  3. poj 3373 Changing Digits (DFS + 记忆化剪枝+鸽巢原理思想)

    http://poj.org/problem?id=3373 Changing Digits Time Limit: 3000MS   Memory Limit: 65536K Total Submi ...

  4. poj和hdu部分基础算法分类及难度排序

    最近想从头开始刷点基础些的题,正好有个网站有关于各大oj的题目分类(http://www.pythontip.com/acm/problemCategory),所以写了点脚本把hdu和poj的一些题目 ...

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

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

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

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

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

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

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

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

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

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

随机推荐

  1. Vue.js 教程

    http://www.runoob.com/vue2/vue-routing.html

  2. HDMI中checksum计算法

    在AVI传输过程中有三个字节没有被传输.这是在HDMI1.4B中找到的前三个字节的数据. >> hex2dec('82') ans = 130 下图中的数据中在HDMI中接收到的一串数据, ...

  3. redis概览

    Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,和Memcached类似,它支持存储的value类型相对更多,包括string(字符串 ...

  4. SpringMVC处理模型数据

    目录结构 web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi= ...

  5. AIX 批量更改密码

    使用 chpasswd 可以使用 chpasswd 方便地更改单个或多个账户密码.这意味着不需要像平时一样在命令行上重复输入密码.尽管可以以交互方式使用 chpasswd,但是我建议以非交互方式使用它 ...

  6. (转)mysql command line client打不开(闪一下消失)的解决办法

    转自:http://www.2cto.com/database/201209/153858.html 网上搜索到的解决办法: 1.找到mysql安装目录下的bin目录路径. 2.打开cmd,进入到bi ...

  7. Java案例:随机点名器

    案例介绍: 随机点名器,即在全班同学中随机的找出一名同学,打印这名同学的个人信息.需具备以下3个内容:1)存储所有同学姓名2)总览全班同学姓名3)随机点名其中一人,打印到控制台 案例需求分析: 全班同 ...

  8. POJ2139--Six Degrees of Cowvin Bacon(最简单Floyd)

    The cows have been making movies lately, so they are ready to play a variant of the famous game &quo ...

  9. Hdu1695 GCD 2017-06-27 22:19 30人阅读 评论(0) 收藏

    GCD Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submis ...

  10. 冲刺博客NO.4

    今天开站立会议时,有一点分歧,原本我认为的隐私保护和其他人认为的不一样,在沟通后这部分功能达成共识. 今天做了什么:组员完成了用户输入部分,信息输入.添加了一些组件和活动完善界面. 遇到的苦难,界面 ...