Skip to content

Commit

Permalink
Atividades e minhas resoluções da aula 02 do assunto if e else
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonwq committed Dec 14, 2024
1 parent b2c6e1c commit 0cc2793
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 0 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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;
}
}
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;
}
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;
}
}
}

0 comments on commit 0cc2793

Please sign in to comment.