cout<<"Numarul de componente pentru care accept lotul [A1]: "<<A1<<endl;
cout<<"Numarul de componente pentru care resping lotul [R1]: "<<R1<<endl;
cout<<"Numarul de componente pentru care accept lotul [A2]: "<<A2<<endl;
cout<<"Numarul de componente pentru care resping lotul [R2]: "<<R2<<endl;
I make what did you said, but terminal print A1=0, R1=0, A2=93743638, R2=0..
Hey,
you appear to be comparing a double using equality. this often fails. It may not be entering either statement because calitate == 0.065 may never be true.
consider
if( abs(calitate - 0.065) > 0.001 && … //0.001 is an example it can be smaller
Directly comparing floating-point values for equality is very error prone if you don't know what you're doing.
Stick to integers for computation if possible.