VB.NET CONSOLE的用法小問

如題各位大大

CONSOLE該如何一行讀取兩個數值呢?

像我輸入80 40 要怎麼讓CONSOLE去判斷這是兩個不同的值

而且又要怎麼去處理這兩個數值呢?

2 Answers

Rating
  • 9 years ago
    Favorite Answer

    Module Module1 Sub Main() Dim data() As Object Dim aa As String Console.Write("請輸入資料,每筆資料用空格分開:") aa = Console.ReadLine() data = Split(aa, " ") Debug.Print(data.GetLongLength(0)) If data.GetLongLength(0) > 0 Then For i As Integer = 0 To UBound(data) Console.WriteLine("你輸入的第" & Str(i + 1) & "筆資料是:" & data(i)) Next End If Console.ReadLine() End SubEnd Module

    Source(s): me
  • Anonymous
    9 years ago

    讀出字串後自己解析

Still have questions? Get your answers by asking now.