Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C by Fimor ( 12 years ago )
#include "stdafx.h"


int _tmain(int argc, _TCHAR* argv[])
{
 int x, y, x1, y1, x2, y2, z=0;

 printf("vvedite koordinaty ladyi: ");
 scanf("%i", &x1;);
 scanf("%i", &y1;);

 printf("vvedite koordinaty ferzya: ");
 scanf("%i", &x2;);
 scanf("%i", &y2;);

 printf("vvedite koordinaty korolya: ");
 scanf("%i", &x);
 scanf("%i", &y);

 if (((x == x1) && (y == y1)) || ((x == x2) && (y == y2)) || ((x1 == x2) && (y1 == y2))) {
  printf("ERROR");
  return 0;
 }

 if (((x == x1) || (y == y1)) && (((x - x1)*(x - x1) != 1) && ((y - y1)*(y - y1) != 1))) {
  z++;
 }

 if ((((x - x2)*(x - x2) == (y - y2)*(y - y2)) && ((x - x2)*(x - x2) != 1)) || (((x == x2) || (y == y2)) && (((x - x2)*(x - x2) != 1) && ((y - y2)*(y - y2) != 1)))) {
  z++;
 }

 if (z != 0) {
  printf("Mat");
 }
 else {
  printf("Mata net");
 }

 return 0;
}

 

Revise this Paste

Your Name: Code Language: