Skip to content

Commit 5a319b3

Browse files
authored
Merge pull request #6 from marlonwq/MARLONWQ
Atividades e minhas resoluções da aula 02 - assunto if e else
2 parents d21c21d + 0cc2793 commit 5a319b3

File tree

6 files changed

+52
-0
lines changed

6 files changed

+52
-0
lines changed
Binary file not shown.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
int X, Y, area_coberta_atual, difusores_necessarios;
6+
cin >> X >> Y;
7+
8+
area_coberta_atual = Y * 9;
9+
difusores_necessarios = X / 9;
10+
11+
if (X % 9 != 0) {
12+
difusores_necessarios = difusores_necessarios + 1;
13+
}
14+
15+
if (area_coberta_atual < X) {
16+
cout << "Precisa de mais difusores!" << endl;
17+
cout << difusores_necessarios - Y << endl;
18+
}
19+
20+
else {
21+
cout << "Lar doce lar." << endl;
22+
}
23+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
int X1, Y1, X2, Y2;
6+
cin >> X1 >> Y1 >> X2 >> Y2;
7+
if (X1 == X2 && Y1 == Y2) {
8+
cout << "Soltar pacote" << endl;
9+
} else
10+
cout << "Nao soltar pacote" << endl;
11+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
char zagueiro, goleiro, drible, chute;
6+
cin >> zagueiro >> goleiro >> drible >> chute;
7+
8+
if (drible != zagueiro) {
9+
cout << "Bloqueado" << endl;
10+
} else {
11+
cout << "Driblado" << endl;
12+
if (chute != goleiro) {
13+
cout << "...e o goleiro pega" << endl;
14+
} else {
15+
cout << "Gol" << endl;
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)