C#中的Console.Read()方法详解


当前第2页 返回上一页

示例2:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

// C# program to illustrate the use

// of Console.Read Method

using System;

   

namespace GFG {

   

class Program {

   

    static void Main(string[] args)

    {

        // Write to console window.

   

        int x;

        Console.WriteLine("Enter your Character to get Decimal number");

        x = Console.Read();

        Console.WriteLine(x);

   

        // Converting the decimal into character.

        Console.WriteLine(Convert.ToChar(x));

    }

}

}

输出:

2cb0d4403b3b17b2c23996822faea0b.png

相关推荐:《C教程》

本篇文章就是关于C#中的Console.Read()方法详解,希望对需要的朋友有所帮助!

以上就是C#中的Console.Read()方法详解的详细内容!

返回前面的内容

相关阅读 >>

vs寻找C#的运行库文件

使用C#生成pdf文件流的代码案例分享

C#是什么,能做些什么?

浅谈C#方法的六种参数

如何看待C#中的out和ref?探讨它们之间的区别

C# .net 将list序列化

C# 创建mdi窗体(图文)

C#winform创建excel文件的示例代码分享

详细介绍C#代码与javascript函数的相互调用

C#二进制字节流查找函数indexof的示例代码详解

更多相关阅读请进入《C#》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    正在狠努力加载,请稍候...