/* Right, Wrong */
using System;
public class InputDemo {
public static void Main(){
Console.Write("Input a single character: ");
char ch = (char)Console.Read();
Console.WriteLine("Character read: {0}", ch);
Console.ReadLine();
Console.Write("Input an integer: ");
int i = int.Parse(Console.ReadLine());
Console.WriteLine("Integer read: {0}", i);
Console.Write("Input a double: ");
double d = double.Parse(Console.ReadLine());
Console.WriteLine("Double read: {0:f}", d);
}
} | |
Read char, return int
Read rest of line, string
|