Cpp quiz says answers wrong when it’s not. | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Cpp quiz says answers wrong when it’s not.

So I’m doing the cpp course and I’m at the end of module 2 doing the end task called “Countdown” Here’s my code and it is correct but after the one it gives at the end there’s a space below the 1 and in the expected results there’s no extra line after it counts down to 1. So how can I fix it so it doesn’t give a new line after the countdown gets to 1?? My code is basically the exact same as this code but I tried even copying and pasting this code an nothin https://code.sololearn.com/c11usit1dAK0/?ref=app

22nd May 2021, 1:35 AM
Pokemon PTA
Pokemon PTA - avatar
6 Respuestas
+ 3
Pokemon PTA Maybe you are missing something. Can you copy code from there and share here so we can check where is problem.
22nd May 2021, 2:13 AM
A͢J
A͢J - avatar
+ 1
I just tested your code in the code coach expected and it run fine (all tests passed) ^^
22nd May 2021, 1:59 AM
visph
visph - avatar
+ 1
you fail the test because you have 'beep' lowercased, while it is expected to be capitalized ('Beep')
22nd May 2021, 10:57 PM
visph
visph - avatar
+ 1
Pokemon PTA There is nothing wrong in your code just change "beep" to "Beep"
23rd May 2021, 3:36 AM
A͢J
A͢J - avatar
0
#include <iostream> using namespace std; int main() { int n; cin >> n; //your code goes here while(n>0){ cout<<n<<endl; if(n%5==0) cout<<"beep"<<endl; n--; } return 0; }
22nd May 2021, 10:50 PM
Pokemon PTA
Pokemon PTA - avatar
0
This is the code but when its technically corr evt but in the CPP course at the end of module two (22. Countdown) the code problem you write says its wrong. And the only differece i see between mine and the results is after the number 1 thers a extra space on the next line. 4 3 2 1 (Extra blank space in my code here) But in the expected results there is no soace after one as above..
22nd May 2021, 10:54 PM
Pokemon PTA
Pokemon PTA - avatar