为了账号安全,请及时绑定邮箱和手机立即绑定
慕课网数字资源数据库体验端
C#开发轻松入门_学习笔记_慕课网
为了账号安全,请及时绑定邮箱和手机立即绑定

C#开发轻松入门

绿豆开门 其它
难度入门
时长 4小时43分
  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { for (int i=6;i>=1;i--)//请填写for循环结构 { Console.WriteLine("Yeah!"); } } } }
    查看全部
    0 采集 收起 来源:编程练习

    2018-03-22

  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { int x = 2; do { x++; Console.Write(x+" "); } while(x>2&&x<=4); } } }
    查看全部
  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { for (int x=1;x<=12; x++)//一定记得申明变量X类型 { Console.WriteLine(x+" "); } } } }
    查看全部
    0 采集 收起 来源:C#中for循环

    2018-03-22

  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { int x = 1; int sum = 0;//和,初始化为0 while (x <= 30)//循环条件 { if ((x+1)%2==0)//筛选条件 sum += x; x++; } Console.Write("1-30奇数的和:"+sum); } } }
    查看全部
  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { int x;//循环计数变量 x=5; //行① 请填写计数变量的初始化语句 while ( x>=1 )//行② 请填写循环条件 { Console.Write("加油!"); x--;//行③ 请填写计数变量的自加语句 } } } }
    查看全部
    0 采集 收起 来源:编程练习

    2018-03-22

  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { int y = 5; while (y>=1)//请输入 { Console.Write(y+" "); y--;//请输入 } } } }
    查看全部
  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { string job = "处长";//职务 switch (job) { case "局长": Console.Write("发双黄月饼"); break; case "处长": Console.Write("发蛋黄月饼"); break; case "科长": Console.Write("发枣泥月饼"); break; default : Console.Write("发五仁月饼"); break; } } } }
    查看全部
    0 采集 收起 来源:C#的switch结构

    2018-03-22

  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { int year = 2015;//年份 string text=year%4==0?"闰年":"平年"; Console.WriteLine("今年是{0}",text); } } }
    查看全部
  • 求余数 “变量名”% 数
    查看全部
  • 变量名称: 必须以字母或下划线开头。 可以包含数字,下划线。 不能与C#中的关键字和库函数名称相同。
    查看全部
    0 采集 收起 来源:练习题

    2017-01-04

  • 使用变量分为3步:声明、赋值、使用。 声明变量的语法:数据类型 变量名; 给变量赋值的语法:变量名=值;
    查看全部
    0 采集 收起 来源:C#的变量

    2017-01-04

  • static 静态的 string 字符串 using 引用其他命名空间中的类
    查看全部
    0 采集 收起 来源:练习题

    2017-01-04

  • const double PI 常量 双精度浮点型 命名的名字
    查看全部
    0 采集 收起 来源:C#的常量

    2017-01-04

  • 请注意:如果与其他运算在同一语句中,++写在变量前面或后面,算法不一样,请看下例: Console.WriteLine(age++);作用等同于下面两句: Console.WriteLine(age);//先打印 age=age+1;//后自加 Console.WriteLine(++age);作用等同于下面两句: age=age+1;//先自加 Console.WriteLine(age);//后打印 你看,运算顺序不一样吧,所以输出的结果也不会相同。
    查看全部
  • (int)强制转换数据类型
    查看全部
    0 采集 收起 来源:C#的类型转换

    2017-01-04

举报

0/150
提交
取消
课程须知
本课程是C#基础课程,热烈欢迎各位小伙伴拍砖吐槽!!
老师告诉你能学到什么?
1、C#的基本概念 2、Visual Studio的使用技巧 3、C#的语法和程序逻辑
友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!