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

C#开发轻松入门

绿豆开门 其它
难度入门
时长 4小时43分
  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { int year = 2015;//年份 Console.WriteLine(year%4);//求年份除以4的余数 } } }
    查看全部
  • http://img1.sycdn.imooc.com//55a6126e0001456906970171.jpg
    查看全部
  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { int _num1 = 5;//第一个加数 int _num2 = 7;//第二个加数 int sum=_num1+_num2;//求和 Console.WriteLine("和是{0}",sum);//打印结果 } } }
    查看全部
  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { string today;//今天的午饭 string tomorrow;//明天的午饭 today = "鱼香肉丝"; tomorrow = "小鸡炖蘑菇"; //请在这里补充代码,实现变量today和tomorrow的交换 string temp; temp = tomorrow; tomorrow = today; today = temp; //打印 Console.WriteLine("我今天吃{0},明天吃{1}。",today,tomorrow); } } }
    查看全部
    0 采集 收起 来源:编程练习

    2018-03-22

  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { string today;//今天的午饭 string tomorrow;//明天的午饭 today = "鱼香肉丝"; tomorrow = "小鸡炖蘑菇"; //请在这里补充代码,实现变量today和tomorrow的交换 string temp; temp = today; tomorrow = today; tomorrow = temp; //打印 Console.WriteLine("我今天吃{0},明天吃{1}。",today,tomorrow); } } }
    查看全部
    0 采集 收起 来源:编程练习

    2018-03-22

  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { string boy = "秀丽";//男孩名字 string girl = "伟强";//女孩名字 string temp;//中间变量 temp = boy;//把男孩的名字赋值给temp boy = girl//把女孩的名字赋值给男孩 girl = temp//把temp中的名字赋值给女孩 Console.WriteLine("男孩叫"+boy+" 女孩叫"+girl); } } }
    查看全部
    0 采集 收起 来源:算法——交换

    2018-03-22

  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { string hobby;//声明变量保存爱好 hobby = "剑道";//给爱好变量赋值 Console.WriteLine("我爱好"+hobby);//打印变量 } } }
    查看全部
    0 采集 收起 来源:C#的变量

    2018-03-22

  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { string hobby;//声明变量保存爱好 hobby = "剑道";//给爱好变量赋值 Console.WriteLine("我爱好"+hobby);//打印变量 } } }
    查看全部
    0 采集 收起 来源:C#的变量

    2018-03-22

  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { string hobby;//声明变量保存爱好 hobby = "剑道";//给爱好变量赋值 Console.WriteLine("我爱好"+hobby);//打印变量 } } }
    查看全部
    0 采集 收起 来源:C#的变量

    2018-03-22

  • using System; using System.Collections.Generic; using System.Text; namespace Test { class Program { static void Main(string[] args) { const string CITY = "布宜诺斯艾利斯";//常量,城市 const string NAME = "列奥波尔多·福图纳托·加尔铁里·卡斯特利";//常量,姓名 Console.WriteLine(NAME+"出生在"+CITY+"的一个工人家庭");//使用常量 } } }
    查看全部
    0 采集 收起 来源:C#的常量

    2018-03-22

  • Main不是关键字
    查看全部
    0 采集 收起 来源:练习题

    2017-05-20

  • F5 调试 CTRL + F5 不调试,直接运行
    查看全部
  • C#中Main函数被static修饰,其原因是程序要运行类里面的Main函数就需要将Main函数实例化,而Main函数是程序入口,没有进入Main函数也就没有开始程序,也就无法实例化Main方法,为了解决这种矛盾,则将Main函数设为static修饰的静态函数。
    查看全部
  • 主函数的格式为static void Main (string[] args)无返回值,接收的命令行参数为字符串数组形式保存。
    查看全部
  • string 声明字符串 使用变量分为3步:声明、赋值、使用。 声明变量的语法:数据类型 变量名; 给变量赋值的语法:变量名=值;
    查看全部
    0 采集 收起 来源:C#的变量

    2017-05-19

举报

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

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