[个人笔记]C# 基础语法

1 篇文章 0 订阅
本文档展示了C#编程中的一些基本概念,包括使用`Days`枚举,创建`User`对象,执行算术运算,类型转换,以及条件判断。示例涵盖了`int`类型的变量初始化,字符串连接,以及`switch`语句和`if`语句的用法。此外,还提到了离线视频操作步骤和大黄蜂播放器的下载链接。
摘要由CSDN通过智能技术生成
public static void Main(string[] args) {
    int a = "";
}
/**
 * SGA 006 041 051 063 088 091 138 139 141 143 145 147 
 * SIRO 3981 4001 4272 4521
 * DIC 045 067 077 081 082
 * 
 * 
 * 
 * 
 */
 /**
  * 朝夕离线看视频操作步骤
  * https://docs.qq.com/doc/DQWVaWVRwa2pqZU9i
  * 
  * 大黄蜂播放器官方下载地址:
  * https://www.360dhf.cn/dhfplayer/
  * 
  */
public static void Main(string[] args) {
    Days day = Days.Friday;
    User user = new User();
    user.Id = 1;
    user.Name = "Fresh";
    int a = user.Add(255,255);
    Console.WriteLine(a);
}
public static void Main(string[] args) {
    Days day = Days.Friday;
    User user = new User();
    user.Id = 1;
    user.Name = "Fresh";
    int a = user.Add(255,255);
    object o = a;
    int b = (int)o;
    dynamic c = 233;
    
    string url_ = "server=.\\sqlexpress";

    string url = @"server=.\sqlexpress";

    string id = "23";
    int e = int.Parse(id);
    int f = 0;
    int.TryParse(id,out f);
    Console.WriteLine(a);
    int g = Convert.ToInt32(id);
    int h = Convert.ToInt32(o);
    int i = 0;

    int j = 1;
    int k = 2;
    j = i + k;
    const int l = 34;
    int type = 1;
    string name = type == 1 ? "add" : "edit";
    mix = 255;
}
public string Context() {
    mix = 233;
    if (mix > 23) {
        int m = 56;
    }
    return "{'x':'1'}";
}
public static void Main(string[] args) {
    int score = 56;
    int grade = 1;
    if (score >= 90 && score <= 100) {
        grade = 1;
    } else if (score >= 80 && score < 90) {
        grade = 2;
    } else if (score >= 70 && score < 80) {
        grade = 3;
    } else if (score >= 60 && score < 70) {
        grade = 4;
    } else {
        grade = 5;
    }
    char c = 'a';
    switch(score / 10){
        case 10:
            grade = 1;
            break;
        case 9:
            grade = 2;
            break;
        case 8:
            grade = 3;
            break;
        case 7:
            grade = 4;
            break;
        default:
            grade = 5;
            break;
    }
    if (score > 60) {
        grade = 4;
    } else {
        if (score <= 40) {

        } else if (score > 0) {

        }
    }
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值