.


:




:

































 

 

 

 


5.3. string




 

#include <iostream>

#include <string>

 

using namespace std;

 

int main (void)

{

// ;

string stext1;

 

// ;

getline(cin, stext1, '.');

 

// ;

string stext2;

 

// ;

cin >> stext2;

 

// ;

if (stext1.find(stext2))

stext1.replace(stext1.find(stext2), stext2.size(), "...");

 

// ;

if (stext1.find(stext2))

stext1.erase(stext1.find(stext2), stext2.length());

 

// ;

char *cstr = const_cast<char*>(stext1.data());

 

cout << cstr << endl;

 

return 0;

}

 

5.4. . .

pair string , . , . .

, . . :

vector ( ).

list ( ).

deque ( , ).

, .

queue ( FIFO: ).

stack ( LIFO: ).

priority_queue ( ).

, . , . :

map ( ).

multimap ( ).

set ( , ).

multiset ( ).

.

5.2. .

begin()
end()
rbegin()
rend()

 

5.3. .

front()
back()
at() , ( )
[] , ( )

 

5.4. .

push_back()
pop_back()
push_front() ( )
pop_front() ( )

 

5.5. .

insert(a, c) a c
insert(a, b, c) b a c
erase(a) a
clear()

 

5.6. .

[] ( )
find()
lower_bound()
upper_bound() ,
equal_range() lower_bound() upper_bound()
key_comp()
value_comp()

 

5.7. .

size()
empty()
max_size()
resize()
capacity()
reserve()
swap()
!=, ==, >, <, >=, <=, =
=
assign(a, b) a b

 

, algorithm numeric . , . , , .

, . * . , .

, , string.

 

5.5. vector

vector . vector. , , . , , .

5.8. .

vector()
vector(a) a
vector(a, b) a b
vector(c) c

 

, , : begin end iterator, rbegin rend reverse_iterator.

 





:


: 2016-09-06; !; : 340 |


:

:

, , .
==> ...

1902 - | 1570 -


© 2015-2024 lektsii.org - -

: 0.013 .