#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. 组合索引leaf 数据存储

    1 Z 2 X 3 U 4 T 5 G 6 F 7 C 8 B 9 A 1 A 2 B 3 C 4 D Oracle的索引是以平衡树的方式组织存储的:保存的是索引列的值,以及该行的rowid的一部分( ...

  2. 【转】Android:控件Spinner实现下拉列表

    原文网址:http://www.cnblogs.com/tinyphp/p/3858920.html 在Web开发中,HTML提供了下拉列表的实现,就是使用<select>元素实现一个下拉 ...

  3. Codeforces Round #203 - D. Looking for Owls

    D. Looking for Owls Emperor Palpatine loves owls very much. The emperor has some blueprints with the ...

  4. UITableView的刷新

    UITableView的刷新1> 数据刷新的总体步骤* 修改模型数据* 刷新表格(刷新界面) 2> 刷新表格(刷新界面)的方法* 全局刷新(每一行都会重新刷新)- (void)reload ...

  5. String path = request.getContextPath();这段什么用

    <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+ ...

  6. Android经常使用的五种弹出对话框

    一个Android开发中经常使用对话框的小样例,共同拥有五种对话框:普通弹出对话框,单选对话框,多选对话框,输入对话框及进度条样式对话框: <LinearLayout xmlns:android ...

  7. [RxJS] Observables can complete

    The Observer object has the functions next() and error(). In this lesson we will see the other (and ...

  8. [React Testing] Setting up dependencies && Running tests

    To write tests for our React code, we need to first install some libraries for running tests and wri ...

  9. Python-xml解析常用方法简介

    [XML几种解析方法] 常见的XML编程接口有DOM和SAX,这两种接口处理XML文件的方式不同,使用场合自然也就不同. Python有三种方法解析XML: SAX,DOM,以及ElementTree ...

  10. EF中的自动追踪与代理

    自动追踪 EF框架会自动追踪实体的变化(通过比较实体的当前值与原始值). 默认情况下,以下方法会自动触发实体变化的追踪 DbSet.Find DbSet.Local DbSet.Remove DbSe ...