Write a C++ program to create a new string taking 3 characters from the middle of a given string at least 3
- برمجة سي بلس بلس
- برمجة
- 2021-05-11
- MarwaMohammed
الأجوبة
#include <iostream>
using namespace std;
string test(string s1)
{
return s1.substr((s1.length() - 1) / 2 - 1, 3);
}
int main()
{
cout << test("Hello") << endl;
cout << test("Python") << endl;
cout << test("abc") << endl;
return 0;
}أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال
