This commit is contained in:
2022-04-18 00:13:14 +08:00
parent 9cfd26e75f
commit a364ed7a78
187 changed files with 2030 additions and 15 deletions

9
onefile/README.md Normal file
View File

@@ -0,0 +1,9 @@
# 单文件 (onefile)
## 简介
单文件小程序
## 支持
每个文件都是一个不同的程序
请分别根据注释运行
## 协议
详见文件内部注释
如无注释, 根据 GPL 3.0 协议开源

31
onefile/file_reader.cpp Normal file
View File

@@ -0,0 +1,31 @@
// main.cpp
// author: Wang Zhiyu
// SFIS C++ Project
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]){
fstream config;
config.open(argv[1], ios::in);
if(config){
cout << "Reading Data" << endl;
vector<string> data;
string tmp;
while(getline(config,tmp)){
data.push_back(tmp);
}
cout << "Redirect to terminal:" << endl;
for(int i = 0;i < data.size();i++){
cout << data[i] << endl;
}
config.close();
}
else{
cout << "File NOT Found" << endl;
}
cout << "Press any key to Continue...";
cin.clear();
cin.sync();
cin.get();
return 0;
}