cac bai ma minh da lam.cac banj cho y kien nha.
Trang 1 trong tổng số 1 trang
cac bai ma minh da lam.cac banj cho y kien nha.
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);
*/
}
}
}
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);
*/
}
}
}
buithanhdien10th- Tổng số bài gửi : 2
Join date : 23/01/2011
Similar topics
» Bài tập 1,2 của mình mấy bạn cho ý kiến nha
» bai 1: minh lam hoi khac, cac ban cho y kien!
» Bài tập 5: tính tổng (1/2->1/n)
» Bài tập 2: Giải phương trình trùng phương
» may ban giup minh nha
» bai 1: minh lam hoi khac, cac ban cho y kien!
» Bài tập 5: tính tổng (1/2->1/n)
» Bài tập 2: Giải phương trình trùng phương
» may ban giup minh nha
Trang 1 trong tổng số 1 trang
Permissions in this forum:
Bạn không có quyền trả lời bài viết
|
|