问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

二进制如何转为十进制(浮点数 c++)

发布网友 发布时间:2022-05-02 02:12

我来回答

5个回答

热心网友 时间:2022-06-26 19:20

"10 >> 2"
,"十进制转为二进制"
,"十进制数值∶",0,,,,"#NUM!","二进制数值∶",0
,2,0,"…",0,1,"#NUM!"
,2,0,"…",0,10,"#NUM!"
,2,0,"…",0,100,"#NUM!"
,2,0,"…",0,1000,"#NUM!"
,2,0,"…",0,10000,"#NUM!"
,2,0,"…",0,100000,"#NUM!"
,2,0,"…",0,1000000,"#NUM!"
,2,0,"…",0,10000000,"#NUM!"
,2,0,"…",0,100000000,"#NUM!"
,2,0,"…",0,1000000000,"#NUM!"
"2 >> 10"
,"二进制转为十进制"
,,,,"#NUM!",,"於十进制的值"
,"二进制数值∶",0,,"#NUM!",10,0,"x",2,0,"=",0
,,,,"#NUM!",100,0,"x",2,1,"=",0
,"十进制数值∶",0,,"#NUM!",1000,0,"x",2,2,"=",0
,,,,"#NUM!",10000,0,"x",2,3,"=",0
,,,,"#NUM!",100000,0,"x",2,4,"=",0
,,,,"#NUM!",1000000,0,"x",2,5,"=",0
,,,,"#NUM!",10000000,0,"x",2,6,"=",64
,,,,"#NUM!",100000000,0,"x",2,7,"=",128
,,,,"#NUM!",1000000000,0,"x",2,8,"=",256
,,,,"#NUM!",10000000000,0,"x",2,9,"=",512
,,,,,100000000000,"总和= ",,,,,0
"10>>2(digit)"
,"十进制小数转为二进制小数"
,"十进制小数∶",,,"小数部份乘二","整数部份","小数部分"
,,,,0,0,0,0.1
,"二进制小数∶",0,,0,0,0,0.01
,,,,0,0,0,0.001
,,,,0,0,0,0.0001
,,,,0,0,0,"1E-05"
,,,,0,0,0,"1E-06"
,,,,0,0,0,"1E-07"
,,,,0,0,0,"1E-08"
,,,,0,0,0,"1E-09"
,,,,0,0,0,"1E-10"
,,,,0,0,0,"1E-11"
,,,,0,0,0,"1E-12"
,,,,0,0,0,"1E-13"
,,,,0,0,0,"1E-14"
,,,,0,0,0,"1E-15"
,,,,0,0,0,"1E-16"
,,,,0,0,0,"1E-17"
,,,,0,0,0,"1E-18"
,,,,0,0,0,"1E-19"
,,,,0,0,0,"1E-20"
,,,,0,0,0,"1E-21"
"2>>10(digit)"
,"二进制小数转为十进制小数"
,"二进制小数∶",,,,,"数位"
,,,0,10,,0,"x",2,-1,"=",0
,"十进制小数∶",0,0,100,,0,"x",2,-2,"=",0
,,,0,1000,,0,"x",2,-3,"=",0
,,,0,10000,,0,"x",2,-4,"=",0
,,,0,100000,,0,"x",2,-5,"=",0
,,,0,1000000,,0,"x",2,-6,"=",0
,,,0,10000000,,0,"x",2,-7,"=",0
,,,0,100000000,,0,"x",2,-8,"=",0
,,,0,1000000000,,0,"x",2,-9,"=",0
,,,0,10000000000,,0,"x",2,-10,"=",0
,,,,,,,,,"总和∶",,0

热心网友 时间:2022-06-26 19:20

楼上的 好像还是不能解决浮点数的问题啊
int i=0;
int j,k=0;
double value=0.0;
char d[100];
cout<<"请输入:\n";
cin>>d;
j=strlen(d);
for(i=(j-1);i>=0;i--)
{
if(d[k++]=='1')
value+=double(power(2,i));
};
cout<<"十进制是:"<<value<<endl;
这段可以解决二进制转为十进制 但是不能实现浮点数的运算 大家继续帮忙啊(我是楼主)

热心网友 时间:2022-06-26 19:21

楼上的,你用的是什么语言,我怎么看不明白啊。
用c语言编程:
include<stdio.h>
include<math.h>
main()
{struct stack{
int top;
int base;
int a[];};
a=(int *)malloc(100*sizeof(int);//动态分配空间
top=base=0;//建立一个空栈
int m;
long s=0;
int list[]={"在此输入你想转换的二进制数"};
m=strlen(list);
int b[m];
int *p=list;
if(*p!=\0)
{a[top]=*p;top++;p++;}
do{ for(i=0;;i++)
b[i]=a[--top];
}when(top==base);
for(i=0;i<m;i++)
s=s+pow(int (2*b[i]),int i);
printf("%ld",s);
}

热心网友 时间:2022-06-26 19:21

用8421算最简单,从二进制的后面开始算起,例如
100010010111,从后面4个为一组,二进制为1的数字对应,为0的数字不对应!!!

8 4 2 1
0 1 1 1
0+4+2+1=7
记住要从后向前算!!

热心网友 时间:2022-06-26 19:22

用计算机知识你可以啦
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
中美有什么经济冲突 杨凌衡水实验中学高中学费是多少 蒂芙尼珍珠项链怎么清洗和保养? tiffany&amp;co 的缺点 如何保养蒂芙尼的项链? tiffany保养要多久时间 Tiffany珠宝需要多长时间保养? 人为什么活着,怎样活着都是无憾!! 孩子犟的不行家长怎么教育 有什么比较好用的游戏视频录制软件? 适用于Windows的10个好用的游戏录制软件 每天先原地慢跑40分钟,再休息10分中,然后在跳绳30分钟,照这样能减肥吗? 原地跑步和跳绳哪个减肥效果好 32位二进制补码转浮点数 用的c语言 谢谢 比如fffffff5 将二进制转换为浮点数,比如数字为0xf3 4a是多少? 或者18 66是多少 跳绳有效还是原地跑步有效 急!!!c++二进制浮点数转标准浮点数 跳绳 和 原地慢跑 哪个消耗的热量更多? 二进制数怎么转化为浮点数?阶码又是怎么算出来的? 跳绳和原地跑步哪个更有效果 原地跑步效果好还是跳绳效果好?跳绳腿会变粗吗? 与对方车辆发生剐蹭,当时不知情,对方通过交警联系到了我,并且狮子大开口我该怎么办?_百度问一问 齐齐哈尔有什么好玩的地方? 齐齐哈尔空间布局特点 齐齐哈尔地区军事历史特点 齐齐哈尔男人有什么地域特征?适合做老公吗 夏季齐齐哈尔市的气候特征 你们累吗? 正常行车期间被别的车剐蹭了,不知情走了怎么办? 猕猴桃和奇异果有什么区别吗? 为什么我活的累,你累吗?,心累 经常跳绳和原地跑步是不是又可以减肥又可以增高啊 我急需类似这种浮点数运算工具,可以把浮点数转成10进制单双精度或者16进制单双精度,百度找不到 原地跳绳能代替慢跑的运动效果吗? 浮点数如何转成二进制数?也就是用二制数如何来表示浮点数? OPPO A52的锁屏密码忘了,如何通过邮箱找回?? 减肥用原地跑好还是跳绳好? 二进制-0.0110101转化为IEEE754短浮点数规格化表示,麻烦写一下详细步骤,谢谢 每天原地跑步和跳绳能不能瘦肚子和小腿? OPPO A52的锁屏密码忘了,可以通过云服务找回吗?? 怎么把12位AD的二进制数转成浮点数再把浮点数的每一位转成ASCII码输出给12864液晶 OPPO A52的锁屏密码忘了,可以通过邮箱找回吗?? 减肥跳绳好还是原地跑不好 浮点数转换为二进制,小数部分怎么转换,请教大家 减肥是原地慢跑好,还是跳绳好? 怎样把二进位转化成单精度浮点数?谢谢! 高分求-1000.5的二进制,转换成 短浮点数格式 的过程 原地跑步30分钟好还是跳绳2000下好 在宿舍里 跳绳原地跑步 空气不好 有坏处吗? 有二进制转换器吗?直接转八进制,十进制,十六进制之类的?最好是软件形式的 跳绳和跑步哪个更伤膝盖?