Testando

They told him don’t you ever come around here
Don’t want to see your face, you better disappear
The fire’s in their eyes and their words are really clear
So beat it, just beat it
You better run, you better do what you can
Don’t want to see no blood, don’t be a macho man
You want to be tough, better do what you can
So beat it, but you want to be bad
Just beat it, beat it, beat it, beat it
No one wants to be defeated
Showin’ how funky and strong is your fight
It doesn’t matter who’s wrong or right
Just beat it, beat it
Just beat it, beat it
Just beat it, beat it
Just beat it, beat it
They’re out to get you, better leave while you can
Don’t want to be a boy, you want to be a man
You want to stay alive, better do what you can
So beat it, just beat it
You have…

Você terá que fazer mais um if para verificar se o número é múltiplo de 5, se for, você faz um for desse numero até 1 (pois ele quer em forma decrescente) e verifica se esses números são multiplos de 5

Ex:
50 é múltiplo de 5
ai o for vai de 50 até 1

49 é multiplo de 5? Não, então vamos pro próximo
48? não
47? não
46? não
45? Sim, então printa.

1 curtida

Muito obrigado. O que eu queria saber é como ficaria esse outro for.

for(int i = 1; i <= 100; i++) Isso iria de 1 ate 100, incrementando em 1
for(int i = 100; i >= 1; i–) Isso iria de 100 ate 1, decrementando em 1

Voce precisa decrementar de x até 1, onde x é multiplo de 5

1 curtida