Feature/solve first homework - #1
Open
ArtEnjoyer wants to merge 3 commits into
Open
Conversation
ArtEnjoyer
force-pushed
the
feature/solve_first_homework
branch
from
November 12, 2022 08:28
9065338 to
7e91fd4
Compare
LostPointer
suggested changes
Nov 19, 2022
| #include <stack> | ||
| #include <string> | ||
| #include <vector> | ||
| using namespace std; |
| using namespace std; | ||
| std::vector<std::string> SplitString(const std::string& data) { | ||
| return {}; | ||
| std::vector<std::string> v; |
| return {}; | ||
| std::vector<std::string> v; | ||
| std::string buff = ""; | ||
| bool flag = false; //скобки закрыты (или их нет) |
There was a problem hiding this comment.
flag тоже не очень, что это за флаг, за что он отвечает, комментарий это конечно хорошо, но лучше когда код сам по себе читабельный
| std::vector<std::string> v; | ||
| std::string buff = ""; | ||
| bool flag = false; //скобки закрыты (или их нет) | ||
| cout << size(data) << endl; |
There was a problem hiding this comment.
думаю это отладка, лучше убрать после того как отладился
| } else if (data[i] == ')') { | ||
| flag = false; //скобки закрыты | ||
| } | ||
| if (((data[i] != ' ') and (data[i] != '\t')) or (flag == true)) { |
There was a problem hiding this comment.
В C++ не принято писать and и or, используй вместо && и ||
| if (((data[i] != ' ') and (data[i] != '\t')) or (flag == true)) { | ||
| buff += data[i]; | ||
| } | ||
| cout << "Data" << i << " : " << data[i] << endl; |
| } | ||
| } else { | ||
| if (i + 1 >= size(data)) { | ||
| if (buff != "") { |
| if (i + 1 >= size(data)) { | ||
| if (buff != "") { | ||
| v.push_back(buff); | ||
| buff = ""; |
| if (str.empty()) flag= false; | ||
| for (size_t i=1;i<str.size();++i) | ||
| { | ||
| if ((str[i]>='0') && (str[i]<='9'))/* if (std::isdigit(str[i]))*/a=1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
commitariy