fourth point

this is a problem from uva judge(10242)..
and this is the link of the whole question
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=1183&mosmsg=Submission+received+with+ID+12962809

And this is my code:


#include <iostream>
#include<iomanip>

using namespace std;

int main()
{
double x1,x2,x3,x4,x5,y1,y2,y3,y4,y5;
while(cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4)
{
if(x1==x2 && y1==y2)
{
x5=x3+x4-x1;
y5=y3+y4-y1;
}
else if(x1==x3 && y1==y3)
{
x5=x2+x4-x1;
y5=y2+y4-y1;
}
else if(x1==x4 && y1==y4)
{
x5=x2+x3-x1;
y5=y2+y3-y1;
}
else if(x2==x4 && y2==y4)
{
x5=x1+x3-x2;
y5=y1+y3-y2;
}
else if(x2==x3 && y2==y3)
{
x5=x1+x4-x2;
y5=y1+y4-y2;
}
else if(x3==x4 && y3==y4)
{
x5=x1+x2-x3;
y5=y1+y2-y3;
}
cout<<setprecision(3)<<showpoint<<fixed<<endl;
cout<<x5<<" "<<y5;
}
return 0;
}

where did I screw up??
tawsif95 wrote:
where did I screw up??
You screwed up when you didn't explain what your program does that you do not want it to do. Does it cause the UVA judge to explode and force you to pay for the damages? Does it generate a runtime error? Does it get detected as a virus by your browser? Does it get time limit exceeded? Does the NSA want to talk to you about this code? Do you get the wrong answer? Be specific.
Last edited on
Topic archived. No new replies allowed.