c#go.md

first project in visual studio

  1. console app
  2. ref: bro code
using System;
namespace CGO
{
    class Program 
    {
        static void Main(string[] args)
        {
            Console.WriteLine("hello world");
            Console.Beep();// a beep voice                      
            Console.Write(Environment.NewLine+"hey");
            Console.ReadKey();
        }
    }   
}

ch1

// comment
/**/
int x = 1;
double y = 2.2;
float z = 1.2f;
bool b = true;
char x = 'x';
string name = "etcix";
String why = "wtf";
const double E = 2.7;

ch2

static void Test()
{
    double a = 1.22;
    int b = Convert.ToInt32(a);
    Console.WriteLine(b);
    Console.WriteLine(a.GetType());
}
// v2
static void Test()
{
    Console.WriteLine("what is your name?");
    String name = Console.ReadLine();
    Console.WriteLine("hello " + name);
    int age = Convert.ToInt32(Console.ReadLine());
    Console.WriteLine("your age is " + age);
}

ch3

int a = Math.Abs(-11);
double s = Math.Pow(a,2);

ch4

// Random 
Random r = new Random();
Console.WriteLine(r.Next(1,2));
Console.WriteLine(r.NextDouble());
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值