Movie tickets c++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Movie tickets c++

My code compiles the wanted result in my IDE but not in the compiler of the sololearn app. Can I see your code to see what's wrong?

11th Mar 2021, 6:30 PM
Bineu
5 Answers
+ 2
share your code in playground
11th Mar 2021, 7:27 PM
Arturop
Arturop - avatar
+ 1
This here is what i had to use to make this work. The first for loop is to set up the rows and then the nested for loop is to change the values to 1 and print them out. Hope it helps. //your code goes here for (int x=0; x < rows; x++) { for (int y=0; y < cols; y++) { matrix[x][y] = 1; cout << matrix[x][y]; } cout << "" << endl; }
31st Dec 2021, 10:05 AM
Jonathan E
Jonathan E - avatar
0
#include <iostream> using namespace std; int main() { int rows = 6; int cols = 6; float matrix[rows][cols] = { {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, }; // your code goes hre for(int row=0;row<6;row++);{ // matrix[0][6]=1; //cout<<matrix[0][0]; for(int col=0;col<6;col++){ matrix [0][6]=1; cout<<matrix [0][6]; } cout<<endl; } return 0; }
11th Mar 2021, 8:38 PM
Bineu
0
My IDE was visual studios
11th Mar 2021, 8:38 PM
Bineu
0
Thank you guys, I was trying to put the matrix in the "for" function and it would just mess everything up. Appreciated!
15th Jan 2022, 11:01 PM
Jacob Martinez