// IOHelper.h
#pragma once
#include <iostream>
#include <string>
class IO {
private:
IO();
~IO();
public:
// 输出字符串到屏幕
static void Output(std::string str, bool endl = true);
// 获取一行输入
static bool Input(std::string &str);
};
// IOHelper.cpp
#include "IOHelper.h"
#include <fstream>
IO::IO() {
}
IO::~IO() {
}
void IO::Output(std::string str, bool endl /* = true*/) {
std::cout << str;
if (endl) {
std::cout << std::endl;
}
}
bool IO::Input(std::string &str) {
if (getline(std::cin, str)) {
return true;
} else {
return false;
}
}