c#基础接触(打卡)

来源:互联网 发布:php 检验 excel 编辑:程序博客网 时间:2024/05/18 00:03
using System;using System.Collections.Generic;using System.Text;namespace Test{    class Program    {static void Main(string[]args){Console.WriteLine("hello world!");}}}

1.        所有关键字都是由小写字母组成的,C#语言中,大小写是严格区分的。

2.        代码中的Console.WriteLine()与之前的Console.Write()不同,后者不换行,而前者会在打印之后换行。

3.        static表示“静态的”。 string表示“字符串”数据类型。 using常常写在类的前面,用来引用其他命名空间中的类。

4.        const关键字,表明PI是一个常量; double 关键字,表明PI的类型为“双精度浮点型”(一种精度很高的数字类型)。

5.        C#中没有boolean类型

6.        C#中的switch,每个分支都应该以break;结束,break的作用是跳出switch结构。但是,如果某个分支中没有语句,那么也可以不写break;

7.        int[,]arr = new int[2,3];//二维数组声明

8.        Console.ReadLine();//从控制台接收值

9.        int a= int.parse(Console.ReadLine());//类型转换


原创粉丝点击