-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntersectie_Multimi.cpp
More file actions
68 lines (63 loc) · 1.75 KB
/
Copy pathIntersectie_Multimi.cpp
File metadata and controls
68 lines (63 loc) · 1.75 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
#include <bits/stdc++.h>
using namespace std;
constexpr int NMAX = 1000;
constexpr int NRMAX = 50;
int n;
char numereNaturale[NMAX + 1]{ '\0' };
char numereIntregi[NMAX + 1]{ '\0' };
char numereRationale[NMAX + 1]{ '\0' };
char numereIrationale[NMAX + 1]{ '\0' };
char s[NRMAX + 1];
void solve() {
cin >> n;
while (n--) {
cin >> s;
if (strstr(s, "...") != nullptr) {
strcat(numereIrationale, s);
strcat(numereIrationale, " ");
} else if (strchr(s, '.') != nullptr) {
strcat(numereRationale, s);
strcat(numereRationale, " ");
} else if (strchr(s, '-') != nullptr) {
strcat(numereRationale, s);
strcat(numereRationale, " ");
strcat(numereIntregi, s);
strcat(numereIntregi, " ");
} else {
strcat(numereRationale, s);
strcat(numereRationale, " ");
strcat(numereIntregi, s);
strcat(numereIntregi, " ");
strcat(numereNaturale, s);
strcat(numereNaturale, " ");
}
}
if (!strlen(numereNaturale)) {
cout << "Multime vida\n";
} else {
cout << numereNaturale << '\n';
}
if (!strlen(numereIntregi)) {
cout << "Multime vida\n";
} else {
cout << numereIntregi << '\n';
}
if (!strlen(numereRationale)) {
cout << "Multime vida\n";
} else {
cout << numereRationale << '\n';
}
if (!strlen(numereIrationale)) {
cout << "Multime vida\n";
} else {
cout << numereIrationale << '\n';
}
}
int main() {
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}