diff --git a/test1.cpp b/test1.cpp new file mode 100644 index 0000000..b1c4244 --- /dev/null +++ b/test1.cpp @@ -0,0 +1,49 @@ +#include +#include "big_data_int.h" + +string getString(){ + auto* str = new string(); + str->reserve(100); + std::cout << "请输入内容:"; + std::cin.getline(str->c_str(), 100); // 直接读取到缓冲区 + + std::cout << "输入内容:" << str->c_str() << std::endl; + + return str; +} + +int main() +{ + cout<<"please input two numbers:"<>op; + big_data_int a(s_a), b(s_b), c; + switch (op.c_str()[0]) { + case '+': + c = a + b; + break; + case '-': + c = a - b; + break; + case '*': + c = a * b; + break; + case '/': + c = a / b; + break; + case '%': + c = a % b; + break; + default: + cout<<"Wrong operator input"<