zoukankan      html  css  js  c++  java
  • 语言基础

    string name,dw;

                Console.Write("请输入您的名字:");

                 name = Console.ReadLine();

                Console.Write("请输入您的年龄:");

                 int age = int.Parse(Console.ReadLine());

                Console.Write("请输入您的工作单位:");

                 dw = Console.ReadLine();

                Console.WriteLine("我叫" + name + ",今年" + age + "岁了,现在在" + dw + "上班。");

       

                Console.ReadLine();

    Console.Write("请输入一个100以内的整数:");

                int a = int.Parse(Console.ReadLine());

                if (a % 7 == 0)

                    Console.WriteLine("你输入的是7的倍数!");

                {

                }

                if (a % 10 == 7)

                    Console.WriteLine("你输入的个位数是7!");

                if (a / 10 == 7)

                    Console.WriteLine("你输入的十位数是7!");

     

           

    Console.Write("请输入一个数字:");

                int a = int.Parse(Console.ReadLine());

                Console.Write("请再输入一个数字:");

                int b = int.Parse(Console.ReadLine());

                Console.WriteLine("两个数字相加"+(a+b));

                Console.WriteLine("两个数字相减" + (a- b));

                Console.WriteLine("两个数字相乘" + (a * b));

                Console.WriteLine("两个数字相除" + (a / b));

                Console.ReadLine();


    算术运算符: ++ -- , * / %, + -
    关系运算符:<> >= <= == !=

    逻辑运算符:&& 逻辑与 || 逻辑或 !逻辑非
    赋值运算符:= += -= *= /= %=

  • 相关阅读:
    Cannot instantiate the type List&lt;Integer&gt;
    MATLAB新手教程
    SecureCRT学习之道:SecureCRT经常使用快捷键设置与字体设置方法
    socket编程——一个简单的样例
    GridView编辑删除操作
    SpringMVC经典系列-13使用SpringMVC处理Ajax请求---【LinusZhu】
    hud 1241 Oil Deposits
    【Android UI设计与开发】之具体解释ActionBar的使用
    Sublime Text 3 史上最性感的编辑器
    八大排序算法
  • 原文地址:https://www.cnblogs.com/yuyingming/p/4917816.html
Copyright © 2011-2022 走看看