for (int y=0;y<5;y++){
int a8=rand()%10;
int b8=rand()%20;
int c8=rand()%10;
int d8=rand()%20;
int e8;
int aa=(a8*d8)-(b8*c8);
int bb=b8*d8;
cout<<a8<<endl<<b8<<endl<<c8<<endl<<d8<<endl<<aa<<endl<<bb<<endl<<endl;
cout << "fu2 result is: "<<fu2(a8, b8, c8, d8)<<endl<<endl;
}
int &fu2 = (aa < bb) ? aa : bb;
for (int fu2i=2; fu2i<=fu2; fu2i++)
while ((aa%fu2i==0) && (bb%fu2i==0))
{
aa /= fu2i;
bb /= fu2i;
cout<<"Funal fu2: "<<aa<<" / "<<bb<<endl<<endl;
}
p.s. just to tell that other variables, a8to d8, are fine generating, and fu2 is bravely counting the result!!!