C#之Hello world

本文详细介绍了如何在Visual Studio 2015中配置环境并编写第一个C#程序HelloWorld,同时展示了如何从键盘接收输入,并在控制台输出。通过本文,初学者可以快速掌握C#的基本语法和VS2015的使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

C#入门之VS2015的Helloworld输出

1.环境配置

注意截图里面的1,2,3顺序
启动

2.程序编写

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Case1
{
    class Program
    {
       /* 
         static void Main(string[] args) // hello world
        {
            string message; // 字符串
            message = "Hello world!";
            System.Console.WriteLine(message);
            System.Console.ReadKey();
        }
        */
        static void Main(string[] args)  // 从键盘获得输入
        {
            string message; // 字符串
            message = System.Console.ReadLine();
            System.Console.WriteLine("我的输入是:"+message);
            System.Console.ReadKey();
        }
    }
}

3.程序解释

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值