/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <string>
using namespace std;
int main()
{
string text = "HTTP/1.1 200 OK\n"
"Date: Fri, 30 Oct 2022 23:11:51 GMA\n"
"Server: Apache/246 (Win64) OpenSSL/1.1.1g PHP/7.4.9\n"
"X-Powered-By: PHP/7.9\n"
"Content-Length: 123\n"
"Connection:\n"
"Content-Type: asddasadssad text/html; charset=UTF-8\n"
"\n"
"pretty good :)";
int lines = 0;
const char *p = &text[0];
for(int i = 0; i < text.length(); i++){
if(p[i] == '\n')
lines++;
}
for(int i = 0; i < lines; i++){
text.erase(0, text.find("\n") + 1);
}
cout << text;
return 0;
}