how to make this matrix work? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 4

how to make this matrix work?

i think i dont know how to initialize it https://code.sololearn.com/ciBqs149Jum5/?ref=app

21st Aug 2018, 9:38 PM
Țucu🇷🇴
Țucu🇷🇴 - avatar
2 ответов
+ 9
First thing I notice straight away is that your inner `for` loop is missing braces `{` and `}`. One very good way to lower the chances of messing up braces is to always indent your code correctly. Indentation is not obligatory in C/C++ but it makes code much more readable and maintainable. Edit: done some corrections, now it seems to work. for(int i=0;i<5;i++) { for(int j=0;j<=5;j++) { a[i][j] == chance; cout << a[i][j] << " "; } cout << endl; }
21st Aug 2018, 9:49 PM
Eduardo Petry
Eduardo Petry - avatar
+ 3
thanks
21st Aug 2018, 11:41 PM
Țucu🇷🇴
Țucu🇷🇴 - avatar