0
What's the meaning of 'stray'
It's what I had in this code.
7 ответов
- 1
Mbengue Mbor i told about stray
+ 2
When you copying code from any source then this error occuring . To remove this error you need to rewrite your code self
+ 1
Mbengue Mbor
It's not an issue of copy code, it is an issue of \n because you used without double quotes (" ")
\n should be inside double quotes (" ")
Btw your program first should print number then "Beep" for example if input is 10 then output should be like this:
10
Beep
9
8
7
6
5
Beep
4
3
2
1
https://code.sololearn.com/cKW1Vb0RLQ4W/?ref=app
+ 1
many thanks
0
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
//your code goes here
for(int i = n; i >= 1; i--){
if(i % 5 == 0){
cout << "Beep"\n;
}else{
cout << i\n;
}
}
return 0;
}
0
It's mine I copy it from the course
0
Ok thanks