#include<cstdio>
#include<iostream>
using namespace std; int pow(int a,int b)
{
int ans = ;
while(b--)
{
ans *= a;
}
return ans; }
int main()
{
//freopen("input.txt","r",stdin);
int T;
int a,b,num,k;
char opl,opr;
while(cin>>T)
{
num = ; while(T--)
{
cin>>a>>opl>>b>>opr;
k = ;
while(a)
{
num += a%*pow(b,k++);
a /= ;
} }
cout<<num<<endl;
}
return ;
}

hdu 1.2.8的更多相关文章

  1. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  2. 【HDU 3037】Saving Beans Lucas定理模板

    http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...

  3. hdu 4859 海岸线 Bestcoder Round 1

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...

  4. HDU 4569 Special equations(取模)

    Special equations Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u S ...

  5. HDU 4006The kth great number(K大数 +小顶堆)

    The kth great number Time Limit:1000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64 ...

  6. HDU 1796How many integers can you find(容斥原理)

    How many integers can you find Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d ...

  7. hdu 4481 Time travel(高斯求期望)(转)

    (转)http://blog.csdn.net/u013081425/article/details/39240021 http://acm.hdu.edu.cn/showproblem.php?pi ...

  8. HDU 3791二叉搜索树解题(解题报告)

    1.题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=3791 2.参考解题 http://blog.csdn.net/u013447865/articl ...

  9. hdu 4329

    problem:http://acm.hdu.edu.cn/showproblem.php?pid=4329 题意:模拟  a.     p(r)=   R'/i   rel(r)=(1||0)  R ...

  10. HDU 2586

    http://acm.hdu.edu.cn/showproblem.php?pid=2586 题意:求最近祖先节点的权值和 思路:LCA Tarjan算法 #include <stdio.h&g ...

随机推荐

  1. 爬虫初窥day3:BeautifulSoup

    信息提取 1.通过Tag对象的属性和方法 #!/usr/bin/python # -*- coding: utf- -*- from urllib.request import urlopen fro ...

  2. mac install brew

    $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ...

  3. 2017/2/16:自己ajax+json习惯性写法 代码拼接的写法 +json用post提交乱码的原因

    1.先导入jquery的包 2.ajax的写法跟注意点 返回一个list的写法 代码拼接写法: html层: 2.script处 4:在你前面传递参数的时候没有遇到乱码问题的情况下,你使用json并且 ...

  4. 2017/2/5:oracle数据库的三大文件

    oracle的三大文件: 一:控制文件:控制文件是一个小型的二进制文件,可以记录数据库的物理结构.包括:     * 数据库名称     * 数据文件和日志文件的名称和位置     * 数据库创建的时 ...

  5. The Django Book第七章(表单)

    从Request对象中获取数据 在views函数里.我们常常写到 from django.http import HttpResponse def hello(request): return Htt ...

  6. QualNet/EXata的发展贯穿在美军网络中心战演进的始终

    QualNet/EXata的发展贯穿在美军网络中心战演进的始终 赵玉亭 1.   QualNet/EXata的前身GloMoSim是美国防部高级计划研究局(DARPA)在1994年启动的全球移动信息系 ...

  7. 31、iOS 正则表达式判断UITextField是否为全汉字,全字母,全数字,数字和字母

    判断全汉字 if ([self deptNameInputShouldChinese]) { [DemonAlertHelper showToastWithMessage:@"只能是中文&q ...

  8. liunx基础命令

    linux的简单介绍 linux是一款免费使用和自由传播的内似于unix的操作系统软件,是一个基于POSI和unix的多用户,多任务,支持多线程和多CPU的一种操作系统.主要用于服务器,特别是网络服务 ...

  9. mybatis 使用merge into

    前一篇博客,oracle的merge into语法 : oracle merge into语法 mybatis 使用merge into,跟一般的update写法相同: <update id=& ...

  10. ajax from 提交

    $.ajax({                 cache: true,                 type: "POST",                 url:aj ...