C++ 命令行窗口输入 Posted on 2022-11-14 | In 算法 | | 阅读数 C++ 命令行窗口输入 参考leetcode的playground https://leetcode.cn/playground/new/empty/ 12345678910111213141516171819202122232425class Solution {public: int add(int a, int b) { }};int stringToInteger(string input) { return stoi(input);}int main() { string line; while (getline(cin, line)) { int a = stringToInteger(line); getline(cin, line); int b = stringToInteger(line); int ret = Solution().add(a, b); string out = to_string(ret); cout << out << endl; } return 0;}