C++ | Sololearn: Learn to code for FREE!

+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; }

c++

10/20/2021 2:55:37 AM

Mando

9 Answers

New Answer

+5

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.

+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`

+3

Don't expect people to put effort into helping you if you're not even willing to put any effort into asking your question. https://www.sololearn.com/Content-Creation-Guidelines? https://code.sololearn.com/Wv5gTHy1N6Ji/?ref=app https://www.sololearn.com/discuss/1316935/?ref=app https://code.sololearn.com/W3uiji9X28C1/?ref=app https://www.sololearn.com/discuss/333866/?ref=app

+2

I wanna try to help you, but I'm not getting the work of the program. How can we bridge this gap?

+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

+1

Mando Can you just tell me in simple way, what condition qualifies for printing "... Jackpot" so we can think this through ...

0

Why when i input arr[0][1] it doesnt work aka doesnt say amoung us jackpot

0

No i made this code it s a project i am doing.

0

Well i think the problem in the code is the input