+ 1
Binary matrix building
Hello everyone, I have bad english, but I hope you will understand my problem. I have a task to create algorithm to build binary matrix for N variables, using only "for" loops and dynamic arrays. For example: We ask user to enter the N variable User enters 3 Program displays: 1 1 1 1 1 0 1 0 1 1 0 0 0 1 1 0 1 0 0 0 1 0 0 0 I hope you get it. I have my own code, but it always get an error in VS. Here the link on my code https://code.sololearn.com/c8Q01ipCY76o/#cpp
13 Respuestas
+ 1
Truly, it is a truth table for Boolean function, and the right column enters the user. There will be the 0 and 1 for users function. So, why don't fill matrix horizontally? I don't know how XD. Btw thanks for answering.
+ 1
Thank you, u really helped me
+ 1
Your code is Ok you just miss to include cmath header and thats all
Just
#include <cmath>
On the top of your code and it will work perfectly
0
Share your code here.
0
Yes, I added a code, so you can see that program works for n≤3, but for bigger n it crashes because of some memory troubles. I can't solve this for 3 days, so I have to ask for help.
0
It's look good, but I need whole matrix, coz I build sknf/sdnf using this matrix. I thought I should tell this all from the start, so sorry for it. But anyway thanks for help, think I can do smth with your advices.