HDU 2106 Decimal System
来源:互联网 发布:淘宝联盟使用教程 编辑:程序博客网 时间:2024/04/29 19:02
#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
int i,j,t,n,m,sum,l;
char s[100];
while(scanf("%d",&t)!=EOF)
{
sum=0;
while(t--){
scanf("%s",s);
l=strlen(s); m=0;
for(i=l-2;s[i]!='(';i--)
m+=(s[i]-'0')*pow(10,l-2-i);
n=0;
for(j=i-1;j>=0;j--){
n+=(s[j]-'0')*pow(m,i-1-j);
}
//printf("m = %d n = %d\n",m,n);
sum+=n;
}
printf("%d\n",sum);
}
return 0;
}
#include<math.h>
#include<string.h>
int main()
{
int i,j,t,n,m,sum,l;
char s[100];
while(scanf("%d",&t)!=EOF)
{
sum=0;
while(t--){
scanf("%s",s);
l=strlen(s); m=0;
for(i=l-2;s[i]!='(';i--)
m+=(s[i]-'0')*pow(10,l-2-i);
n=0;
for(j=i-1;j>=0;j--){
n+=(s[j]-'0')*pow(m,i-1-j);
}
//printf("m = %d n = %d\n",m,n);
sum+=n;
}
printf("%d\n",sum);
}
return 0;
}
- HDU 2106 decimal system
- HDU 2106 decimal system
- HDU 2106 Decimal System
- hdu-2106-decimal system
- hdu 2106 decimal system
- decimal system hdu 2106
- hdu 2106 decimal system
- HDU 2106 decimal system
- hdu 2106 decimal system
- HDU 2106 decimal system
- HDU-2106(decimal system)
- hdu acm 2106 decimal system
- HDU 2106:decimal system【水】
- hdu 2106 decimal system (数学)
- HDU-2106(decimal system)(进制转换)
- Hdu 2106 decimal system【进制转换】
- HDU 1.2.4 decimal system
- HDU 1.2.4 decimal system
- 为什么HTML中输入中文可自动换行而英文不行?
- Fedora 17 Live CD版在Vmware 安装
- Notepad++ 做perl的IDE。
- python简明教程学习笔记2--函数
- 第九章 Java多线程机制 05_线程同步_5
- HDU 2106 Decimal System
- 堆和栈的区别(转过无数次的文章)
- 看到这几张相片, 我有点想哭.
- [Activeden] slick full website template with cms and 2 skins 中文版
- Vaadin Web应用开发教程(42):数据绑定-Property接口
- android wifi 访问本机web程序
- UVA 846 步数
- Linux下各文件夹的含义
- CMMI3组织级文档列表清单