polish: rm extra endl

This commit is contained in:
kuoi 2023-03-20 19:36:26 +08:00
parent 26e358ffef
commit 0cbec45015

View file

@ -269,16 +269,13 @@ void writeNex(class Sample sam, char* otn) {
ofstream matrixfile(otn); ofstream matrixfile(otn);
string datatype; string datatype;
datatype = checktype(sam.chars[0]); datatype = checktype(sam.chars[0]);
matrixfile << "#NEXUS" << endl; matrixfile << "#NEXUS\nBegin data;\n\tDimensions nchar=" << sam.nchar
matrixfile << "Begin data;" << endl << " ntax=" << sam.ntax << ";\n\tFormat datatype=" << datatype
<< "\tDimensions nchar=" << sam.nchar << " ntax=" << sam.ntax << " missing=? gap=-;\n\tMatrix" << endl;
<< ";" << endl
<< "\tFormat datatype=" << datatype << " missing=? gap=-;" << endl
<< "\tMatrix" << endl;
for (unsigned int i2 = 0; i2 < sam.ntax; i2++) { for (unsigned int i2 = 0; i2 < sam.ntax; i2++) {
matrixfile << "\t\t" << sam.taxas[i2] << "\t" << sam.chars[i2] << endl; matrixfile << "\t\t" << sam.taxas[i2] << "\t" << sam.chars[i2] << endl;
} }
matrixfile << "\t;" << endl << "End;" << endl; matrixfile << "\t;\nEnd;" << endl;
matrixfile.close(); matrixfile.close();
} }
@ -319,8 +316,7 @@ int countfre(string str, char c) {
void writeTnt(class Sample sam, char* otn) { void writeTnt(class Sample sam, char* otn) {
ofstream matrixfile(otn); ofstream matrixfile(otn);
matrixfile << "xread" << endl << "\' \'" << endl; matrixfile << "xread\n\' \'\n" << sam.nchar << " " << sam.ntax << endl;
matrixfile << sam.nchar << " " << sam.ntax << endl;
for (unsigned int i = 0; i < sam.ntax; i++) { for (unsigned int i = 0; i < sam.ntax; i++) {
matrixfile << sam.taxas[i] << "\t" << sam.chars[i] << endl; matrixfile << sam.taxas[i] << "\t" << sam.chars[i] << endl;
} }
@ -410,17 +406,12 @@ void show_help(int help_num) {
<< endl; << endl;
} else { } else {
cout << "\n l、 \t. . . .\n(゚、 。 \t|\\/|*|\\/|*\n l ~ヽ " cout << "\n l、 \t. . . .\n(゚、 。 \t|\\/|*|\\/|*\n l ~ヽ "
" \t| ||| ||\n じしf_,)\t| ||| ||\n" " \t| ||| ||\n じしf_,)\t| ||| ||\n\nMorphology into "
"Molecules into\nGPL;\tGuoyi "
"Zhang;\t2023\n\nArguments:\n-h\t--help;\n-i\t--input\t\t${"
"filename};\n-o\t--output\t${filename};\n\nAccepted "
"formats:\nfas\tfasta;\nnex\tnexus;\nphy\tphylip;\ntnt\tss;"
<< endl; << endl;
cout << "Morphology into Molecules into\n"
<< "GPL;\tGuoyi Zhang;\t2023\n"
<< endl;
cout << "-h\t--help;\n-i\t--input\t\t${filename};\n-o\t--output\t${"
"filename};\n"
<< endl;
cout
<< "Accepted formats:\nfas\tfasta;\nnex\tnexus;\nphy\tphylip;\ntnt\tss;"
<< endl;
} }
} }