31 lines
643 B
C++
31 lines
643 B
C++
#pragma once
|
|
#include <string>
|
|
|
|
struct Result
|
|
{
|
|
std::string hexadecimal;
|
|
|
|
long digit;
|
|
};
|
|
|
|
namespace mixplus
|
|
{
|
|
struct Parser
|
|
{
|
|
// 识别两个字符串并相加
|
|
static long parseAndAdd(int argc, const char** argv);
|
|
|
|
// 格式化输出
|
|
static Result formatResult(long value);
|
|
|
|
// 识别十进制或者十六进制输出
|
|
static long parseNumber(const std::string& input);
|
|
|
|
// 识别十进制
|
|
static long parseDigit(const std::string& input);
|
|
|
|
// 识别十六进制且已去掉0x头部
|
|
static long parseHexadecimal(const std::string& input);
|
|
};
|
|
}
|