diff --git a/test.cpp b/test.cpp index f1266f1..2155171 100644 --- a/test.cpp +++ b/test.cpp @@ -2,12 +2,23 @@ #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:"<>s_a; - cin>>s_b; + s_a = getString(); + s_b = getString(); cout<<"Please input the operator(+,-,*,/,%):"<