-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomparar-element-arr.cpp
More file actions
51 lines (40 loc) · 1.2 KB
/
comparar-element-arr.cpp
File metadata and controls
51 lines (40 loc) · 1.2 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
#include <ctype.h>
#include <iostream>
#include <cstring>
//#include <conio.h> //For Windows
//#include <ncurses.h> //For Linux
#include <cstdlib>
#include <array>
#include <iterator>
using namespace std;
int main(){
char newLetra[1] = {};
array<char, 10> array1 = {'A', 'A', 'A', 'A', 'Q', 'E', 'T', 'F', 'H', 'X'};
array<char, 10> array2 = {'A', 'A', 'A', 'W', 'R', 'A', 'D', 'S', 'H', 'X'};
array<char, 10> array3 = {};
array<char, 10> array4 = {};
char dato[1] = {};
char salida[1] = {};
cout << endl;
bool yes = false;
cout << "**************************************************" << endl;
for (int i = 0; i < 10; i++) {
for (int j = 0; j <= i; j++) {
if(array1[i] == array2[j]){
dato[0] = array1[i];
if(dato[0] != array1[i+1]){
array3[i] = dato[0];
salida[0] = dato[0];
cout << salida[0] << endl;
}
}
}
}
cout << "**************************************************" << endl;
for(auto x : array3)
if(x != ' '){
cout << x << endl;
}
system("pause");
return 0;
}