InfoSystem-MayTinh
using System;
using System.Collections.Generic;
using System.Text;
namespace Thong_Tin_Maytinh
{
class Program
{
static void Main(string[] args)
{
// Thuoc tinh
Console.WriteLine("Ten may tinh: {0}", Environment.MachineName);
Console.WriteLine("He dieu hanh: {0}", Environment.OSVersion);
Console.WriteLine("Bo nho may: {0}", Environment.WorkingSet);
// Phuong thuc
String []drivers =Environment.GetLogicalDrives();
for(int i=0;i<drivers.Length;i++)
{
Console.WriteLine("Drivers {0}:{1}", i,drivers[i]);
}
}
}
}
------
------
------
using System;
using System.Collections.Generic;
using System.Text;
namespace Swich_May_Tinh_Ca_Nhan
{
class Program
{
static void Main(string[] args)
{
int a;
int b;
Console.WriteLine("Moi ban nhap vao so thu nhat: ");
a=int.Parse(Console.ReadLine());
Console.WriteLine("Moi ban nhap vao so thu hai: ");
b = int.Parse(Console.ReadLine());
Console.WriteLine("Moi ban nhap vao phep tinh: ");
Console.WriteLine("1: Cong");
Console.WriteLine("2: Tru");
Console.WriteLine("3: Nhan");
Console.WriteLine("4: Chia");
int chon = int.Parse(Console.ReadLine());
const int cong = 1;
const int tru = 2;
const int nhan = 3;
const int chia = 4;
switch (chon)
{
case cong:
Console.WriteLine("Ket qua la: {0}", a + b);
break;
case tru:
Console.WriteLine("Ket qua la: {0}", a - b);
break;
case nhan:
Console.WriteLine("Ket qua la: {0}", a * b);
break;
case chia:
Console.WriteLine("Ket qua la: {0}", a / b);
break;
default:
Console.WriteLine("Thoat");
break;
}
Console.WriteLine("Cam on ban!!!!!!!!!!!!");
}
}
}
Bạn đang đọc truyện trên: Truyen2U.Com