Skip to content

Commit 2860325

Browse files
Changes to testGenerator
1 parent f53bc51 commit 2860325

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

Diff for: gentest.cpp

+13-9
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,26 @@ int main()
1111
int i=1,a,n,m;
1212
fstream f;
1313
f.open("test3.dat",ios::in | ios::trunc | ios::out);
14-
m=(rand()%40)+2;
1514
n=(rand()%40)+2;
16-
cout<<"M: "<<m<<" N: "<<n<<endl;
17-
f<<m<<" "<<n;
15+
m=(rand()%40)+2;
16+
cout<<"M(number of Coloumns): "<<n<<" N(Number of rows): "<<m<<endl;
17+
f<<n<<" "<<m;
1818
f<<"\n";
1919
while(i<=(m*n))
20-
{
20+
{
2121
a=rand()%10;
2222
//cout<<a<<" ";
23-
f<<a<<" ";
24-
if((i%n)==0)
23+
if(a!=0)
24+
{
25+
//cout<<a<<" ";
26+
f<<a<<" ";
27+
if((i%n)==0)
2528
{
26-
//cout<<"\n";
27-
f<<"\n";
29+
//cout<<"\n";
30+
f<<"\n";
2831
}
29-
i++;
32+
i++;
3033
}
34+
}
3135
return 0;
3236
}

0 commit comments

Comments
 (0)