Untitled
unknown
plain_text
a year ago
698 B
19
Indexable
int a, b, c, d, v;
void tinh()
{
int x = v * d - b, y = a - v * c;
double res = (double)x / y;
if(res * c + d == 0)
{
cout << "NONE";
return;
}
int n = __gcd(x, y);
x /= n;
y /= n;
if(y < 0)
{
x = -x;
y = -y;
}
cout << x << "/" << y;
}
Chris_No_Luv
{
cin >> a >> b >> c >> d >> v;
if(a - v * c != 0)
{
tinh();
return 0;
}
else
{
if(v * d - b == 0)
{
cout << "MULTIPLE";
return 0;
}
else
{
cout << "NONE";
return 0;
}
}
return 0;
}
Editor is loading...
Leave a Comment