#include <iostream>
#include <cstring>
using namespace std;
int main ()
{
string s;
getline(cin, s);
int p = 0;
while(s[p] != 'p')
p++;
cout << s.substr(0, p);
return 0;
}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
#include <cstring>
using namespace std;
int main ()
{
string s;
getline(cin, s);
int p = 0;
while(s[p] != 'p')
p++;
cout << s.substr(0, p);
return 0;
}