Skip to content

Commit f31e001

Browse files
committed
aceito
1 parent b477a6b commit f31e001

File tree

5 files changed

+80
-11
lines changed

5 files changed

+80
-11
lines changed

Exercicios/Flíper.cpp

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

Exercicios/Garçom.cpp

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

Exercicios/PremioDoMilhão.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
#include <iostream>
2-
1+
#include <bits/stdc++.h>
32
using namespace std;
43

54
int main() {
6-
int A, N, cont = 0, i1 = 1, i2 = 0;
7-
cin >> N;
5+
int Dias, AcessoPorDia, Milhao = 0, DiasParaMilhao = 0;
86

9-
while (i1 <= N) {
10-
cin >> A;
11-
if (cont < 1000000) {
12-
cont += A;
13-
i2++;
7+
cin >> Dias;
8+
9+
for(int i = 0; i < Dias; i++){
10+
cin >> AcessoPorDia;
11+
if(Milhao < 1000000){
12+
Milhao +=AcessoPorDia;
13+
DiasParaMilhao++;
1414
}
15-
i1++;
1615
}
1716

18-
cout << i2;
17+
cout << DiasParaMilhao;
18+
1919
}

Exercicios/ProdutoTriplo.cpp

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

Exercicios/lampadas.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
4+
int main() {
5+
int n, a = 0, b = 0, interruptor;
6+
cin >> n;
7+
for (int i = 0;i < n;i++) {
8+
cin >> interruptor;
9+
10+
if (interruptor == 1) {
11+
if (a == 0) a = 1;
12+
else a = 0;
13+
} else {
14+
if (a == 0) a = 1;
15+
else a = 0;
16+
if (b == 0) b = 1;
17+
else b = 0;
18+
}
19+
}
20+
cout << a << endl << b;
21+
return 0;
22+
}

0 commit comments

Comments
 (0)