摘要: ``` include using namespace std; int toInt(char c) { // char c = s; if(c = '0' && c= 'a' && c a b; string str; // 用字符串表示的数字 cin str; bool negative = f 阅读全文
posted @ 2019-09-04 11:49 lllittletree 阅读(1385) 评论(0) 推荐(0) 编辑
摘要: ``` /* 求任意两个不同进制非负整数的转换(2进制~16进制),所给整数在long所能表达的范围之内。 不同进制的表示符号为(0,1,…,9,a,b,…,f)或者(0,1,…,9,A,B,…,F)。 输入 输入只有一行,包含三个整数a,n,b。a表示其后的n 是a进制整数,b表示欲将a进制整数n转换成b进制整数。a,b是十进制整数,2 = #include using namespace st 阅读全文
posted @ 2019-09-04 10:47 lllittletree 阅读(1401) 评论(0) 推荐(0) 编辑