0

Failed test 2 C++

Why second test doesn’t complete if even output is the same with waiting output? Here is cod: #include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = n; i>0; i--){ cout<<i<<endl; if (i%5 == 0 && i>0){ cout<<"Веер"<<endl; } n--; } return 0; }

30th Sep 2021, 9:55 PM
Vladyslav
6 Respuestas
+ 2
Your code outputs this for input "6": 6 5 Beep 4 3 2 1 So it outputs "5" and "Beep" where it should only output "Beep".
30th Sep 2021, 10:16 PM
Simon Sauter
Simon Sauter - avatar
+ 1
The problem was with used language) I wrote Beep in other language and program didn’t want to achieve it
30th Sep 2021, 10:19 PM
Vladyslav
0
Which task? Post your code in the code playground and link it here so people can take a look and see what's going on.
30th Sep 2021, 10:04 PM
Simon Sauter
Simon Sauter - avatar
0
I fix it
30th Sep 2021, 10:05 PM
Vladyslav
0
You need to create a countdown app. You are given a number N, print each number from N to 1 on a separate line. Also, when the current countdown number is a multiple of 5, the application should display "Beep". Example Input Data: 12 Sample Output Data: 12 eleven ten Beep nine
30th Sep 2021, 10:08 PM
Vladyslav
0
Thanks, but it’s okay
30th Sep 2021, 10:18 PM
Vladyslav