-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVectory.cpp
More file actions
74 lines (60 loc) · 1.28 KB
/
Vectory.cpp
File metadata and controls
74 lines (60 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
vector<int> vi;
for (int i = 0; i < 10; i++)
{
vi.push_back(i);
}
for (auto item : vi)
{
cout << item << " ";
}
cout << endl;
vector<string> vs;
cout << "podaj 3 slowa ";
for (int i = 0; i < 3; i++)
{
string s;
cin >> s;
vs.push_back(s);
}
for (auto item : vs)
{
cout << item << " ";
}
cout << endl;
cout << "int vector vi ma " << vi.size() << " elementow " << endl;
vi[5] = 3;
vi[6] = -1;
for (auto item : vi)
{
cout << item << " ";
}
cout << endl;
for (unsigned int i = 0; i < vi.size(); i++)
{
cout << vi[i] << " ";
}
cout << endl;
for (auto i = begin(vi); i != end(vi); i++)
{
cout << *i << " ";
}
cout << endl;
sort(begin(vs), end(vs));
for (auto item : vs)
{
cout << item << " ";
}
cout << endl;
int trojki = count(begin(vi), end(vi), 3);
cout << "vector intow ma " << trojki << "elementy trojek " << endl;
int tees = count(begin(vs[0]), end(vs[0]), 't');
cout << "first word has " << tees << " liter t " << endl;
return 0;
}