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 ...
随机推荐
- related work
Traditional approaches, e.g., genetic algorithm (GA) [2] and ant colony optimization (ACO) [3], can ...
- top k问题
1.top k问题 在海量数据处理中,经常会遇到的一类问题:在海量数据中找出出现频率最高的前k个数,或者从海量数据中找出最大的前k个数,这类问题通常被称为top K问题.例如,在搜索引擎中,统计搜索最 ...
- Html5与Css3知识点拾遗(二)
页面title 选择能简要概括文档内容的文字作为title文字,title核心内容放在前60个字符 分级标题 1.创建分级标题时,避免跳过级别,如h3直接跳到h5,但允许从低级别跳到高级别. 2.不用 ...
- CountDownLatch同步辅助类
CountDownLatch,一个同步辅助类,在完成一组正在其他线程中执行的操作之前,它允许一个或多个线程一直等待. 主要方法 public CountDownLatch(int count); pu ...
- ( 递归 )Fractal -- POJ -- 2083
http://poj.org/problem?id=2083 Fractal Time Limit: 1000MS Memory Limit: 30000K Total Submissions: ...
- 修改Android EditText光标颜色
EditText有一个属性:android:textCursorDrawable,这个属性是用来控制光标颜色的 android:textCursorDrawable="@null&quo ...
- Eclipse配置maven web项目问题总结
clipse创建Maven结构的web项目的时候选择Artifact Id为maven-artchetype-webapp,点击finish之后,一般会遇到如下问题 1. The superclass ...
- iOS 5 故事板进阶(1)
译自<iOS 5 by tutorials> 在上一章,你已经学习了故事板的基本用法.包括如何向故事板中添加 View Controller,通过 segues 切换 View Contr ...
- linux-python在vim下的自动补全功能
linux-python在vim下的自动补全功能 安装配置: wget https://github.com/rkulla/pydiction/archive/master.zipunzip -q m ...
- 机器学习实战-ch3-决策树
决策树是一种新算法: 优点:计算复杂度不高,输出结果易于理解,对中间值的缺失不敏感,可以处理不相关特征数据.缺点:可能会产生过度匹配问题. 决策树算法可用于数据类型:数值型和标称型. 决策树的核心在于 ...