Diễn đàn các môn học - Huỳnh Phước Hải
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.

cac bai ma minh da lam.cac banj cho y kien nha.

Go down

cac bai ma minh da lam.cac banj cho y kien nha. Empty cac bai ma minh da lam.cac banj cho y kien nha.

Bài gửi  buithanhdien10th Sun Jan 23, 2011 8:46 am

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
/*
float a,b,c;
Console.WriteLine("nhap cac canh cua tam giac:");
Console.WriteLine("canh a:\n");
a = Int32.Parse(Console.ReadLine());
Console.WriteLine("canh b:\n");
b = Int32.Parse(Console.ReadLine());
Console.WriteLine("canh c:\n");
c = Int32.Parse(Console.ReadLine());
if ((a + b <= c) || (a + c <= b) || (b + c <= a))
{
Console.WriteLine("day khong la tam giac");

}
else
{
Console.WriteLine("day la tam giac");
float P,S;
P = (a + b + c) / 2;
Console.WriteLine("dien tich tam giac cua ban vua nhap la:");
S=Math.Sqrt(P*(P-a)*(P-b)*(P-c));
Console.WriteLine("ket qua:");
Console.Write(S);
}

//---------------------------------------------------------------------------

Console.WriteLine("chuong trinh tinh tong n so");
int i, n, tong=0;
Console.WriteLine("nhap n:");
n = Int32.Parse(Console.ReadLine());
for (i = 1; i <= n; i++)
{
tong = tong + i;
}
Console.WriteLine("ket qua:");
Console.Write(tong);

//---------------------------------------------------------------------------

Console.WriteLine("chuong trinh tinh tong cac phan so:");
int i, n;
float tong=0;
Console.WriteLine("nhap n:");
n = Int32.Parse(Console.ReadLine());
for (i = 2; i <= n; i++)
{
tong =tong+(float)(1/i);
}
Console.WriteLine("ket qua:");
Console.Write(tong);

//---------------------------------------------------------------------------

Console.WriteLine("chuong trình tính tông he so mu");
int i, n;
double s = 0;
Console.WriteLine("nhap n:");
n = Int32.Parse(Console.ReadLine());
for(i=1;i<=n;i++)
{
s=s+Math.Pow(2,i);
}
Console.WriteLine("ket qua:");
Console.Write(s);

//--------------------------------------------------------------------------

Console.WriteLine("giai phuong trinh trung phuong");

//--------------------------------------------------------------------------

Console.WriteLine("tinh tong 1/2 + 1/4 + 1/6 +...+ 1/n");
int i,n;
float tong = 0;
Console.WriteLine("nhap gia tri n:");
n = Int32.Parse(Console.ReadLine());
for (i = 2; i <= n;i++ )
if (i % 2 == 0)
{
tong = tong + ((float)1 / i);
}
Console.Write(tong);
*/
//--------------------------------------------------------------------------
/*
Console.WriteLine("tìm uoc cua n");
int i, n;
Console.WriteLine("nhap gia tri n:");
n = Int32.Parse(Console.ReadLine());
for (i = 1; i < n; i++)
if (n % i == 0)
Console.Write(";"+i);
if (n % 1 != 0)
Console.Write(";" +i);
*/
//--------------------------------------------------------------------------
/*
Console.WriteLine("tinh tong cac uoc cua n");
int i, n;
int tong = 0;
Console.WriteLine("nhap gia tri n:");
n = Int32.Parse(Console.ReadLine());
for (i = 1; i <=n; i++)
if (n % i == 0)
{
tong = tong + i;

}
Console.Write(tong);

//--------------------------------------------------------------------------

Console.WriteLine("chuong trinh tinh tich cac uoc");
int i, n;
int tich=0;
Console.WriteLine("nhap gia tri n:");
n = Int32.Parse(Console.ReadLine());
for (i = 1; i <= n; i++)
if (n % i == 0)
{
tich=tich*i;

}
Console.Write(tich);
*/
}

}

}
farao

buithanhdien10th

Tổng số bài gửi : 2
Join date : 23/01/2011

Về Đầu Trang Go down

Về Đầu Trang

- Similar topics

 
Permissions in this forum:
Bạn không có quyền trả lời bài viết