Skip to content

Commit 369eb6e

Browse files
committed
aceito
1 parent 2ce007a commit 369eb6e

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

Exercicios/Consecutivos.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main() {
5+
int n, cont = 1, resposta = 0;
6+
long int v, aux = 0;
7+
8+
cin >> n;
9+
10+
for (int i = 0; i < n; i++) {
11+
cin >> v;
12+
cont = v == aux ? cont + 1 : 1;
13+
aux = v;
14+
resposta = cont > resposta ? cont : resposta;
15+
}
16+
17+
cout << resposta;
18+
}

Exercicios/Todos os Divisores.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
int main() {
5+
int x;
6+
cin >> x;
7+
8+
for(int i = 1; i <= x; i++){
9+
if(x % i == 0){
10+
cout << i << " ";
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)