За задача 1 , кода който ми хрумва е,
// zad5.cpp : main project file.
#include "stdafx.h"
#include <iostream>
using std::cout;
using std::cin;
int main()
{ int x,y,p,q;
cout<<"Kordinati po X:"; cin>>x;
cout<<"Kordinati po Y:"; cin>>y;
cout<<"Kordinati po P:"; cin>>p;
cout<<"kordinati po Q:"; cin>>q;
if (x>0&&x<9&&y>0&&y<9&&p>0&&p<9&&q>0&&q<9) cout<<"Vuvedeni sa pravilni kordinati";
else
{
cout<<"Vuvejdate greshni kordinati";
system ("pause");
return 0;
}
if (x==p||y==q)
{
cout<<"Cordinatite na carq i drugata figura suvpadat";
system ("pause");
return 0;
}
if (1==abs(x-p)&&1==abs(y-q)) cout<<"Carq bie";
else cout<<"Carq e daleche";
system ("pause");
return 0;
}
сигурно може да си измисли и доста по опростен вариант...