Skip to content

Commit c93f161

Browse files
committed
Create c6.cpp
1 parent 8494d08 commit c93f161

File tree

1 file changed

+19
-0
lines changed
  • Nível 1 - Lógica/3 - Estrutura de Repetição/exercícios/soluções/marlonwq

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int main() {
5+
int E, P, ataques = 0;
6+
cin >> E >> P;
7+
8+
while (E > 0 && P > 0) {
9+
E -= P;
10+
P--;
11+
ataques++;
12+
}
13+
14+
if (E > 0) {
15+
cout << "F";
16+
} else {
17+
cout << ataques << endl;
18+
}
19+
}

0 commit comments

Comments
 (0)