Created
December 4, 2025 22:52
-
-
Save XoLinA/2a09a78f1d8697e0db7ab89f0fd54a8f to your computer and use it in GitHub Desktop.
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
| #include <iostream> | |
| #include <fstream> | |
| #include <Windows.h> | |
| using namespace std; | |
| int main() | |
| { | |
| const char* html = "C:/Users/Me/Desktop/file.html"; | |
| ifstream file(html); | |
| if (!file.is_open()) | |
| { | |
| cout << "Not found///////////"; | |
| return 0; | |
| } | |
| char ch; | |
| char prev = '\0'; | |
| int openB = 0; | |
| int closeB = 0; | |
| while (file.get(ch)) | |
| { | |
| if (ch == '<' && prev == '<') | |
| { | |
| cout << "Error/// <<"; | |
| return 0; | |
| } | |
| if (ch == '>' && prev == '>') | |
| { | |
| cout << "Error/// >>"; | |
| return 0; | |
| } | |
| if (ch == '<') | |
| { | |
| openB++; | |
| } | |
| if (ch == '>') | |
| { | |
| if (closeB + 1 > openB) | |
| { | |
| cout << "Error/// > without <"; | |
| return 0; | |
| } | |
| closeB++; | |
| } | |
| prev = ch; | |
| } | |
| if (openB != closeB) | |
| { | |
| cout << "Error/// not enough >"; | |
| } | |
| else | |
| { | |
| cout << "GOOD!*************************************************"; | |
| } | |
| file.close(); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment