A lot of the times when I code lets say I have only one cin>> I run my code it compiles but I can do infinite inputs even though in my code I have one input. What is the reason for this?
I checked for infinity loops found none for the specific test case I was working with.
Here's the code if you want to see.
#include <iostream>
using namespace std;
int main()
{
long long a,b,c;
cin >> a >> b >> c;
long long mx,mn;
if(b >= a)
{
b = mx;
a = mn;
}
if(a > b)
{
a = mx;
b = mn;
}
int x;
int r = c;
for(int i = mn; i <= mx; i++)
{
x = i;
if(x - mn == mx - x)
{
for(int j = 0; j < x; j++)
{
c += r * r;
}
cout << c + (mx - mn);
return 0;
}
}
}