C#基础:输入输出函数的使用

 C#基础知识:输入与输出函数,

需要引用using system;

  1.                //输出:System.Console.WriteLine()
  2.             Console.WriteLine("Hello World!!!");//完成后换行
  3.             Console.Write("hello world");//完成后不换行
  4.               //输入
  5.             string str = Console.ReadLine();//输入一行
  6.             Console.WriteLine(str);
  7.             Console.WriteLine("--------------");
  8.             char ch =(char)Console.Read();//输入一个字符
  9.             Console.WriteLine(ch);
  10.             Console.WriteLine("---------------");
  11.             int n = Convert.ToInt32(Console.ReadLine());//输入数字
  12.             Console.WriteLine(n);
  13.             Console.ReadKey();

猜你喜欢

转载自blog.csdn.net/QQhelphelp/article/details/82850408