Code C#: Nhập, xuất với mảng 1 chiều (Console)

Người đăng: share-nhungdieuhay on Thứ Năm, 28 tháng 2, 2013


using System;
static void Main(string[] args){
    int[] a = new int[10];
    //nhap gia tri cho mang 1 chieu
    for (int i = 0; i < 10; i++){
        Console.Write("Nhap a[{0}]=", i);
        a[i] = int.Parse(Console.ReadLine());
    }
    //xuat mang 1 chieu
    for (int i = 0; i < 10; i++){
        Console.WriteLine("{0} ", a[i]);
    }
}

{ 0 nhận xét... read them below or add one }

Đăng nhận xét