CS10B / Assignment 2 / Problem 3: Using the Scanner and Stack classes
Прохожу самостоятельно курс CS106B - Programming Abstractions https://see.stanford.edu/Course/CS106B Не могу розобратся в задании. Что мне нужно сделать? Кто то в кратце может обьяснить. Скидиваю текс в английском оригинале что бы не искозить его.
<html><b><i>CS106 rules!</i></b></html>
Web browsers use stacks to track html tags such as <b>, <i> or <html>. Every html tag must be matched by an equivalent closing tag -- </b>, </i> or </html>. Mozilla is looking for programmers to help implement this feature in the next version of Firefox and you, armed with your newly acquired knowledge of classes, decide to volunteer for the job. Using the Scanner class and the Stack class, write the following function:
bool IsCorrectlyNested(string htmlStr);
You can assume that all the tags in the html string will be correctly formed. That is, once you see an angle bracket, it will be followed by the remainder of a complete and wellformed tag (So, nothing like “<<html>”).