|
c# |
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
int a = Convert.ToInt32(textBox1.Text);
int b = Convert.ToInt32(textBox2.Text);
int c = Convert.ToInt32(textBox3.Text);
listBox1.Items.Add("çevre"+cevreyaz(a,b,c));
listBox1.Items.Add("alan"+alanyaz(a,b,c));
}
int cevreyaz(int a, int b, int c)
{
return a + b + c;
}
double alanyaz(int a, int b, int c)
{
double u=(a+b+c)/2.0;
double alan=0 , hesap ;
hesap=u*(u-a)*(u-b)*(u-c);
alan=Math.Pow(alan,1/2.0);
return alan ;
}
void ücgenmi(int a, int b, int c)
{
bool k1, k2, k3=
k1=(a<b+c && a>b-c && a>c-b );
k2 = ( b<a+c && b>a-c && b>c-a);
k3 = (c < a + b && c > a - b && c > b - a);
if (k1 == true && k2 == true && k3 == true)
{
listBox1.Items.Add("üçgendir");
}
else
{
listBox1.Items.Add("üçgen değildir " );
}
}
void ücgentürü(int a, int b, int c)
{
if (a==b && b==c && a==c )
{
listBox1.Items.Add("eşkenar üçgen ");
}
else if (a==b || b==c || a==c)
{
listBox1.Items.Add("ikizkenar üçgen");
}
else
{
listBox1.Items.Add("çeşitkenar üçgen");
}
}
}
}
0 yorum :
Yorum Gönder