Gửi Tin Nhắn Cho Admin

Thứ Ba, 26 tháng 9, 2017

Hiển Thị Tiếng Việt có Dấu trong màn hình Console

Phạm Minh Tùng  /  at  9/26/2017 10:48:00 CH  /  No comments


- Ta sẽ lấy lại ví dụ tính tổng N số nguyên người dùng nhập vào nhé
Sub Main()
        Dim n As Integer, i As Integer, so As Integer, tong As Integer
        Dim l As New List(Of Integer)

        Console.OutputEncoding = System.Text.Encoding.UTF8
        Console.WriteLine("Số lượng số nguyên mà bạn muốn tính tổng: ")
        n = Console.ReadLine
        For i = 1 To n
            Console.WriteLine("mời bạn nhập số thứ: " & i)
            so = Console.ReadLine
            l.Add(so)
        Next
        For i = 0 To l.Count - 1
            tong += l.Item(i)
        Next
        Console.WriteLine("Tổng của {0} số nguyên nhập vào là {1} ", n, tong)
        Console.ReadLine()
    End Sub

Share
Posted in: Posted on: Thứ Ba, 26 tháng 9, 2017

0 nhận xét:

Recent Comments

Copyright © 2013 Excel Toàn Tập. WP Theme-junkie converted by Bloggertheme9
Blogger templates. Proudly Powered by Blogger.