Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- float pole(float x1,float y1,float x2,float y2,float x3,float y3)
- {
- float ab = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
- float ac = sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
- float bc = sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
- float p = (ab+ac+bc)/2;
- return sqrt(p*(p-ab)*(p-ac)*(p-bc));
- }
- int main()
- {
- int x1=0,x2=0,x3=0,y1=0,y2=0,y3=0,x=0,y=0;
- do{
- cin>>x1>>y1>>x2>>y2>>x3>>y3>>x>>y;
- if((x1==0)&&(x2==0)&&(x3==0)&&(y1==0)&&(y2==0)&&(y3==0)&&(y==0)&&(x==0)){
- return 0;
- }
- float all = pole(x1,y1,x2,y2,x3,y3);
- float abd = pole(x1,y1,x2,y2,x,y);
- float bcd = pole(x2,y2,x3,y3,x,y);
- float acd = pole(x1,y1,x3,y3,x,y);
- float sum = abd+bcd+acd;
- if(((abd==0)||(bcd==0)||(acd==0))&&(all-sum<=1e-6))
- {
- cout<<"E"<<endl;
- }
- else if(all-sum<=1e-6)
- {
- cout<<"I"<<endl;
- }
- {
- cout<<"O"<<endl;
- }
- }while(true);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement