#include <stdio.h>
#include<stdlib.h>
#define N 3
int main(void)
{
srand((unsigned)time(NULL));
int b[N][N], int i, int j;
for( ){
/* need to randomize numbers 1-9 here in matrix but I don't know how*/
if(b[0][0]+b[1][0]+b[2][0]=b[0][1]+b[1][1]+b[2][1]=b[0][2]+b[1][2]+b[2][2]=b[0][0]+b[0][1]+b[0][2]=b[1][0]+b[1][1]+b[1][2]=b[2][0]+b[2][1]+b[2][2]=b[0][0]+b[1][1]+b[2][2]=b[2][0]+b[1][1]+b[0][2])
printf("/* how do you print the current matrix?*/");
break;
else continue;}
}
and simply want the result to be something like
% ./a.out
4 3 8
9 5 1
2 7 6
Please help me!


Sign In
Create Account


Back to top









