文章
49
粉丝
90
获赞
9
访问
27.7k
for (unsigned long long i = 0; i < s.size(); i++)
{
n += pow(10, s.size() - i - 1) * (s[i] - '0');
}
#include<algorithm>
reverse(s.begin(), s.end());
while (s.size() < 2)
{
s.insert(s.begin(), '0');
}
s += (n % 16 - 10 + 'A');
int dian = 3;
else if (*i == '.')
{
dian--;
if (dian < 0)
{
flag = 0;
cout << "Error" << endl;
break;
}
else
{
r += ten_to_16(t);
t = "";
}
}
#include<algorithm>
#include<cmath>
#include<iostream>
#include<string>
using namespace std;
/*传入一个十进制字符串,转换成int,并判断是否在0 - 255范围内*/
bool is_true(string s)
{
int n = 0;
for (unsigned long long i = 0; i < s.size(); i++)
{
n += pow(10, s.size() - i - 1) * (s[i] - '0');
}
if...
登录后发布评论
暂无评论,来抢沙发