-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from marlonwq/MARLONWQ
Atividades e minhas resoluções da aula 02 - assunto if e else
- Loading branch information
Showing
6 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+107 KB
...- Lógica/2 - Desvios Condicionais/exercícios/aula 02/problemas/B4 - Drone da Amazônia.pdf
Binary file not shown.
Binary file added
BIN
+93.9 KB
...Lógica/2 - Desvios Condicionais/exercícios/aula 02/problemas/B5 - Oxygen Not Included.pdf
Binary file not shown.
Binary file added
BIN
+54.8 KB
... 1 - Lógica/2 - Desvios Condicionais/exercícios/aula 02/problemas/B6 - Fazendo um Gol.pdf
Binary file not shown.
23 changes: 23 additions & 0 deletions
23
Nível 1 - Lógica/2 - Desvios Condicionais/exercícios/aula 02/soluções/marlonwq/B5.CPP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() { | ||
int X, Y, area_coberta_atual, difusores_necessarios; | ||
cin >> X >> Y; | ||
|
||
area_coberta_atual = Y * 9; | ||
difusores_necessarios = X / 9; | ||
|
||
if (X % 9 != 0) { | ||
difusores_necessarios = difusores_necessarios + 1; | ||
} | ||
|
||
if (area_coberta_atual < X) { | ||
cout << "Precisa de mais difusores!" << endl; | ||
cout << difusores_necessarios - Y << endl; | ||
} | ||
|
||
else { | ||
cout << "Lar doce lar." << endl; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Nível 1 - Lógica/2 - Desvios Condicionais/exercícios/aula 02/soluções/marlonwq/b4.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() { | ||
int X1, Y1, X2, Y2; | ||
cin >> X1 >> Y1 >> X2 >> Y2; | ||
if (X1 == X2 && Y1 == Y2) { | ||
cout << "Soltar pacote" << endl; | ||
} else | ||
cout << "Nao soltar pacote" << endl; | ||
} |
18 changes: 18 additions & 0 deletions
18
Nível 1 - Lógica/2 - Desvios Condicionais/exercícios/aula 02/soluções/marlonwq/b6.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() { | ||
char zagueiro, goleiro, drible, chute; | ||
cin >> zagueiro >> goleiro >> drible >> chute; | ||
|
||
if (drible != zagueiro) { | ||
cout << "Bloqueado" << endl; | ||
} else { | ||
cout << "Driblado" << endl; | ||
if (chute != goleiro) { | ||
cout << "...e o goleiro pega" << endl; | ||
} else { | ||
cout << "Gol" << endl; | ||
} | ||
} | ||
} |