#include<string>
#include<stdlib.h>
#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
string s1 = "ywb";
string s2(s1);
string s3 = s2;
string s4("yangwen");
string s5(10, 'c');
cout << s1 << " " << s2 << " " << s3 << " " << s4 << " " << s5 << endl;
string str("yangwenbin");
int length = str.length();
int length1 = str.size();
cout << length << " " << length1 << endl;
for (int i = 0; i < length1; i++)
{
cout << str.at(i) << " " ;
}
cout << endl;
cout << *str.begin() << endl;
cout << *(str.end() - 1) << endl;;
if (!str.empty())
{
cout << "i am not empty" << endl;;
}
str.resize(length + 10, 'a');
cout << str << endl;;
str.clear();
if (str.empty())
{
cout << "i am empty" << endl;;
}
str.append("ywb");
cout << str << endl;
str.append(" hell0");
cout << str;
system("pause");
}