Удаление пробельных символов void DeleteNewLines std string str str er

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Удаление пробельных символов
void DeleteNewLines(std::string &str) {
str.erase(std::remove_if(str.begin(), str.end(),
[](char c){ return (c == ' ' || c == '\n' || c == '\t'); }), str.end());
}
int* GetScoreMatrix(std::string &alphabet, int* index_arr, std::istream& fs){
fs >> std::ws;
std::getline(fs, alphabet);
SpaceErase(alphabet);
for (int i = 0; i < alphabet.length(); i++) {
index_arr[alphabet[i]] = i;
}
int** score_matrix = new int* [alphabet.length()];
for (int i = 0; i < alphabet.length(); i++) {
score_matrix[i] = new int [alphabet.length()];
}
for (int i = 0; i < alphabet.length(); i++) {
for (int j = 0; j < alphabet.length(); j++) {
fs >> score_matrix[i][j];
/*if (i == j) score_matrix[i][j] = 2;
e*lse score_matrix[i][jvoid] = -1;*/
}
}
fs >> penalty;
fs.close();
//
}