C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

C++

#include <iostream> using namespace std; int main() { //here is my start of the amoug us pop it; // i will only be doing the if loops; string arr[5][5] = { {"1pop,2pop,3pop,4pop,5pop"}, {"6pop,7pop,8pop,9pop,10pop"}, {"11pop,12pop,13pop,14pop,15pop"}, {"16pop,17pop,18pop,19pop,20pop"}, {"21pop,22pop,23pop,24pop,25pop"}, } cin >> arr[][]; if (arr[0][0] || arr[0][1] || arr[0][2] || arr[0][3] || arr[0][4]){ cout << AMOUNG US JACKPOT << endl; } else{ cout << "you are a loser lol" << endl; } return 0; }

20th Oct 2021, 2:55 AM
Mando
Mando - avatar
9 Answers
+ 6
Is this a PRO code coach challenge? if it is, try to include the task in the Description, cause non PRO users can't see those. It is advised to save the snippet as code bit, and share its link in the Description. Copy/pasting raw text code takes up space in the Description, you may not be able to put the task details in Description when raw text code occupied the space already.
20th Oct 2021, 6:02 AM
Ipang
+ 3
As Ipang said, it would be better if you would describe what you're trying to code. But the errors that are evident from the code are 1. The line `cin >> arr[][];` Here, `arr[][]` makes no sense. I can't suggest a fix for it unless I understand what you are trying to do. 2. The line `if (arr[0][0] || arr[0][1] || ....` For the || operator, both sides of it must be boolean values. Here, arr[0][0], arr[0][1] and so on are all strings. Again, I don't know what this line is supposed to do, so I can't suggest a fix. There is also a missing semicolon after the declaration of the array `arr`
20th Oct 2021, 6:42 AM
XXX
XXX - avatar
+ 2
I wanna try to help you, but I'm not getting the work of the program. How can we bridge this gap?
20th Oct 2021, 6:04 AM
Ipang
+ 1
#include <iostream> using namespace std; int main() { //here is my start of the amoug us pop it; // i will only be doing the if loops; string anwser; string arr[5][5] = { {"1pop","2pop","3pop","4pop","5pop"}, {"6pop","7pop","8pop","9pop","10pop"}, {"11pop","12pop","13pop","14pop","15pop"}, {"16pop","17pop","18pop","19pop","20pop"}, {"21pop","22pop","23pop","24pop","25pop"}, }; cin >> anwser; if (anwser == arr[0][0] || anwser == arr[0][1] || anwser == arr[0][2] || anwser == arr[0][3] || anwser == arr[0][4]){ cout << "AMOUNG US JACKPOT" << endl; } else{ cout << "you are a loser lol" << endl; } return 0; } I got it
20th Oct 2021, 7:01 AM
Mando
Mando - avatar
+ 1
Mando Can you just tell me in simple way, what condition qualifies for printing "... Jackpot" so we can think this through ...
20th Oct 2021, 7:05 AM
Ipang
0
Why when i input arr[0][1] it doesnt work aka doesnt say amoung us jackpot
20th Oct 2021, 2:56 AM
Mando
Mando - avatar
0
No i made this code it s a project i am doing.
20th Oct 2021, 6:03 AM
Mando
Mando - avatar
0
Well i think the problem in the code is the input
20th Oct 2021, 6:05 AM
Mando
Mando - avatar