Implement branching

This commit is contained in:
Hazem Krimi
2024-05-02 21:26:14 +01:00
parent 8262f49d85
commit 2040a363e3
5 changed files with 97 additions and 14 deletions
+17
View File
@@ -5,6 +5,23 @@
using namespace std;
inline void ltrim(string &str) {
str.erase(str.begin(), find_if(str.begin(), str.end(), [](unsigned char ch) {
return !isspace(ch);
}));
}
inline void rtrim(string &str) {
str.erase(find_if(str.rbegin(), str.rend(), [](unsigned char ch) {
return !isspace(ch);
}).base(), str.end());
}
inline void trim(string &str) {
rtrim(str);
ltrim(str);
}
string generateRandomLabel() {
random_device rd;
mt19937 gen(rd());