
进制转换
文章平均质量分 68
Twan_
东秦
展开
-
十六进制转换成八进制
用字符串实现#include #include using namespace std;int main(){ int n; cin>>n; for(int k=1;k<=n;k++) { string s1,s2; //s1为输入的原始的十六进制串,s2为转化成的二进制串 cin>>s1;转载 2017-04-02 17:20:57 · 882 阅读 · 0 评论 -
十六进制转换十进制
#include#include#includeusing namespace std;void con(string &a,int i){ int b[8]={0}; //用来保存每一个16进制数的10进制数值,如A表示10 int t=0; for(int j=0;j<i;j++) { switch(a[j])原创 2017-04-03 16:11:47 · 727 阅读 · 0 评论 -
十进制转换十六进制
#includeusing namespace std;int main(){ int d[20]={0}; int i=0; //用来表示d数组的下标 int num=0; //所要转化的十进制数 char h[16]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; c原创 2017-04-03 17:01:26 · 1600 阅读 · 0 评论