Розробка власного класу STRING
Курсовой проект - Компьютеры, программирование
Другие курсовые по предмету Компьютеры, программирование
209; (3) - (6) (7). (1) - (7) (1) - (5).
.
(1)
(2)
(3)
(4)
(5)
(6) cout<<"\nEnter string"<<endl;
cin>>test2;
cout<<test2<<endl;
cout<<"Enter string"<<endl;
cin>>test2;
cout<<test2<<endl;
(1) (3) , . (2) (4) , . , . (6) - (11).
:
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14) cout<<"\ns1 is \""<<test1<<"\" and s2 is \""<< test3<<"\""
<<"\n\nThe results of comparing is: "
<<"\ns2==s1 yields "
<< (test3==test1?"true": "false")
<<"\ns2! =s1 yields "
<< (test3! =test1?"true": "false")
s1 yields "
test1?"true": "false")
<<"\ns2<s1 yields "
<< (test3<test1?"true": "false")
<<"\ns2<=s1 yields "
<< (test3<=test1?"true": "false")
=s1 yields "
=test1?"true": "false") <<endl;
(1) , . (3), (5), (7), (9), (11), (13) , , , . (12) - (20).
, (23):
cout << "\n\ns1 += s2 yields s1 = ";
test1 += test3; // test overloaded concatenation
cout << test1<<endl;
2 : 0 ( 0), - , 1, - , (24) - (25):
test1 [0] =t;
test1 [1] =E;
cout<<"s1 after s1 [0] = t and s1 [1] =E"<<endl;
cout<<test1<<endl;
:
(1)
(2)
(3) int pos=test1. find (test3);
test1. TPdelete (pos,test3. lenght ());
cout<<test1<<endl;
pos , (2) test3, . (3) (26) - (27).
:
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16) test1="112211221122";
test3="334433443344334";
cout<<"\ns1 is \""<<test1<<"\" and s2 is \""<< test3<<"\"";
cout<<"Insert to s1 5 symbols from s2. Start position 0: "<<endl;
test1. insert (test3,0,5);
cout<<test1<<endl;
test1="112211221122";
test3="334433443344334";
cout<<"Insert to s1 5 symbols from s2. Start position 5: "<<endl;
test1. insert (test3,5,5);
cout<<test1<<endl;
test1="112211221122";
test3="334433443344334";
cout<<"Insert to s1 5 symbols from s2. Start position end of s1: "<<endl;
test1. insert (test3,test1. lenght (),5);
cout<<test1<<endl;
(1) - (2), (7) - (8), (12) - (13).