-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1285.cpp
More file actions
47 lines (34 loc) · 891 Bytes
/
1285.cpp
File metadata and controls
47 lines (34 loc) · 891 Bytes
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
#include <iostream>
#include <vector>
using namespace std;
bool buscaNoVetor(char d, vector<char> v){
for(char c : v){
if(c == d) return true;
}
return false;
}
int main(){
int n1, n2;
string auxiliar;
vector<char> verificaRepeticao;
vector<int> numeros;
while(cin >> n1 >> n2){
for(int i=n1; i<=n2; i++){
int aux = 0;
auxiliar = to_string(i);
for(char digit : auxiliar){
int busca = buscaNoVetor(digit, verificaRepeticao);
if(busca == 1){
aux++;
} else {
verificaRepeticao.push_back(digit);
}
}
if(aux == 0) numeros.push_back(i);
verificaRepeticao.clear();
}
cout << numeros.size() << endl;
numeros.clear();
}
return 0;
}