#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#define maxn 1000
using namespace std;
char str[maxn]; int change(char *s)
{
int k=strlen(s);
int pos;
int sum=;
for(int i=; i<k; i++)
{
if(s[i]=='(')
{
pos=i;
break;
}
}
int m;
if(s[pos+]=='')
{
m=;
}
else
m=s[pos+]-'';
int j=;
for(int i=pos-; i>=; i--)
{
sum+=(s[i]-'')*pow(m,j);
j++;
}
return sum;
} int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int sum1=;
for(int i=; i<n; i++)
{
scanf("%s",str);
sum1+=change(str);
}
printf("%d\n",sum1);
}
return ;
}

hdu 2106 decimal system的更多相关文章

  1. HDOJ(HDU) 2106 decimal system(进制相互转换问题)

    Problem Description As we know , we always use the decimal system in our common life, even using the ...

  2. HDU 2106 decimal system (进制转化求和)

    题意:给你n个r进制数,让你求和. 析:思路就是先转化成十进制,再加和. 代码如下: #include <iostream> #include <cstdio> #includ ...

  3. 十进制(decimal system)转换函数说明

    一,十进制(decimal system)转换函数说明 1,十进制转二进制 decbin() 函数,如下实例 echo decbin(12); //输出 1100 echo decbin(26); / ...

  4. hdu 2106

    #include <iostream> #include <cmath> #include <string.h> using namespace std; int ...

  5. decimal system 2016

    Problem Description As we know , we always use the decimal system in our common life, even using the ...

  6. 杭电OJ(HDU)-ACMSteps-Chapter Two-《An Easy Task》《Buildings》《decimal system》《Vowel Counting》

    http://acm.hdu.edu.cn/game/entry/problem/list.php?chapterid=1§ionid=2 1.2.5 #include<stdio.h> ...

  7. HDU 3072 Intelligence System (强连通分量)

    Intelligence System Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Othe ...

  8. hdu 1690 Bus System(Dijkstra最短路)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1690 Bus System Time Limit: 2000/1000 MS (Java/Others ...

  9. HDU 4744 Starloop System(ZKW费用流)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4744 题意:三维空间n个点,每个点有一个wi值.每对点的距离定义为floor(欧拉距离),每对点之间建 ...

随机推荐

  1. HDU_2057——64位无符号16进制数的运算

    Problem Description There must be many A + B problems in our HDOJ , now a new one is coming. Give yo ...

  2. HDU_2013——蟠桃记,反向推理

    Problem Description 喜欢西游记的同学肯定都知道悟空偷吃蟠桃的故事,你们一定都觉得这猴子太闹腾了,其实你们是有所不知:悟空是在研究一个数学问题!什么问题?他研究的问题是蟠桃一共有多少 ...

  3. github atom创建自己的语法高亮

    使用atom一段时间了,有些插件还不是很成熟.比如项目中使用protobuf,早就有人写了语法高亮(https://github.com/podgib/atom-protobuf),但是效果不是很好. ...

  4. mongodb的应用场景

    这篇文章总结的比较到位:http://www.tuicool.com/articles/YnmaAj

  5. C#运行时鼠标移动控件 - 调用Windows API(ReleaseCapture)

    [System.Runtime.InteropServices.DllImport("user32.dll")] public static extern bool SendMes ...

  6. Color 颜色码-英文名称-十六进制-RGB对照表

      色 英文代码 形像颜色 HEX格式 RGB格式 LightPink 浅粉红 #FFB6C1 255,182,193 Pink 粉红 #FFC0CB 255,192,203 Crimson 猩红 # ...

  7. google在线測试练习题1

    Problem You receive a credit C at a local store and would like to buy two items. You first walk thro ...

  8. Python 线程池的原理和实现及subprocess模块

    最近由于项目需要一个与linux shell交互的多线程程序,需要用python实现,之前从没接触过python,这次匆匆忙忙的使用python,发现python确实语法非常简单,功能非常强大,因为自 ...

  9. Python发一个GET请求

    # -*- coding: utf-8 -*- try: import httplib2 except ImportError: print('错误:') print(' httplib2这个库没有找 ...

  10. Linux字符设备驱动file_operations

    struct _file_operations struct _file_operations在Fs.h这个文件里面被定义的,如下所示: struct file_operations { struct ...