这个代码为啥会CE?
  • 板块灌水区
  • 楼主Scarab
  • 当前回复11
  • 已保存回复11
  • 发布时间2020/5/16 21:14
  • 上次更新2023/11/7 02:19:25
查看原帖
这个代码为啥会CE?
176843
Scarab楼主2020/5/16 21:14
#include<bits/stdc++.h>
using namespace std;
namespace inout {
	struct IO {
		std::string name;
		ofstream fout;
		IO (std::string _name, int data_id) {
			name = _name + to_string(data_id) + ".in";
			fout.open(name);
		}
		void input_write (int x) {
			fout << x << " ";
			return ;
		}
		void input_write (char x) {
			fout << x << " ";
			return ;
		}
		void input_write (short x) {
			fout << x << " ";
		}
		void input_write (long x) {
			fout << x << " ";
			return ;
		}
		void input_write (long long x) {
			fout << x << " ";
			return ;
		}
		void input_write (std::string x) {
			fout << x << " ";
			return ;
		}
	};
//	inout IO_out(std::string file_preffix, int data_id) {
//		inout cur;
////		string a = cur.name = file_preffix + std::to_string(data_id) + ".in";
////		cur.fout.std::ofstream::open(a);
//		return cur;
//	}
};
using namespace inout;

int main() {
	IO io = IO("check", 1);
	return 0;
}

2020/5/16 21:14
加载中...