fix output beautifully

This commit is contained in:
Zengtudor 2024-08-18 08:20:02 +08:00
parent b1d062626f
commit b6d7ceb4a1

View File

@ -71,7 +71,7 @@ struct ProgramRet{
path outPath; path outPath;
unsigned int id; unsigned int id;
friend std::ostream& operator<<(std::ostream&os,ProgramRet&ret){ friend std::ostream& operator<<(std::ostream&os,ProgramRet&ret){
os<<"ProgramRet { start: "<<ret.start<<" ,end: "<<ret.end<<"outPath: "<<ret.outPath<<" ,id: "<<ret.id<<" }"; os<<"ProgramRet { start: "<<ret.start<<" ,end: "<<ret.end<<" ,outPath: "<<ret.outPath<<" ,id: "<<ret.id<<" }";
return os; return os;
} }
}; };
@ -86,11 +86,11 @@ struct Statu{
int id; int id;
friend std::ostream& operator<<(std::ostream &os,Statu &s){ friend std::ostream& operator<<(std::ostream &os,Statu &s){
if(s.isTLE){ if(s.isTLE){
os<<"tests "<<s.id<<" TLE"; os<<"tests\t"<<s.id<<"\tTLE";
}else if(s.cmp==0){ }else if(s.cmp==0){
os<<"tests "<<s.id<<" AC"; os<<"tests\t"<<s.id<<"\tAC";
}else{ }else{
os<<"tests "<<s.id<<" WA line:"<<s.cmp; os<<"tests\t"<<s.id<<"\tWA line:"<<s.cmp;
} }
return os; return os;
} }
@ -242,6 +242,7 @@ int main(int argc, char* argv[]) {
.id=i .id=i
}; };
} }
cout<<endl<<"----------results---------"<<endl;
for(int i=1;i<=jsonTests.size();i++){ for(int i=1;i<=jsonTests.size();i++){
cout<<status[i]<<endl; cout<<status[i]<<endl;
} }
@ -253,11 +254,11 @@ int compareFiles(const std::string& path1, const std::string& path2) {
std::ifstream file2(path2); std::ifstream file2(path2);
if (!file1.is_open()) { if (!file1.is_open()) {
std::cerr << "无法打开文件: " << path1 << std::endl; std::cerr << "cannot open the file at: " << path1 << std::endl;
exit(1); exit(1);
} }
if (!file2.is_open()) { if (!file2.is_open()) {
std::cerr << "无法打开文件: " << path2 << std::endl; std::cerr << "cannot open the file at: " << path2 << std::endl;
exit(1); exit(1);
} }