-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program_7uzdavinys_is_lapu.cs
34 lines (33 loc) · 1.18 KB
/
Program_7uzdavinys_is_lapu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp131
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("iveskite Virsutinio kairiojo tasko pirma kordinate X1:");
int x1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("iveskite Virsutinio kairiojo tasko antra kordinate Y1:");
int y1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("iveskite Apatinio desniojo tasko pirma kordinate X2:");
int x2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("iveskite Apatiniojo desniojo tasko pirma kordinate Y2:");
int y2 = Convert.ToInt32(Console.ReadLine());
int S = y1 * x2;
int P = (y1 * 2) + (x2 * 2);
if(x2>x1&&y1>y2)
{
Console.WriteLine("Staciakampio PLOTAS yra: " + S + "\n Staciakampio PERIMETRAS yra : " + P);
}
else
{
Console.WriteLine("Salyga negalima nes, X2<X1 ir Y1<Y2, ");
}
Console.ReadKey();
}
}
}