zoukankan      html  css  js  c++  java
  • 2015.3.3(上)

    练习题:

    (一)   1—100之间,输入两个数,算两个数之间的和?

    //Console.WriteLine("请输入一个整数");             //int a = Convert.ToInt32(Console.ReadLine());             //Console.WriteLine("请在输入一个整数");             //int b = Convert.ToInt32(Console.ReadLine());             //int x = 0;             //for (int i = a; i <=b; i++)             //{             //    x = x +i;             //}             //Console.WriteLine(x);             //Console.ReadLine();

    (二)  1—100之间,输入两个数,再输入一个符号,求(+,-,*,/)?

     //           Console.WriteLine("请输入一个数");  //           double c = Convert.ToDouble(Console.ReadLine());  //           Console.WriteLine("请在输入一个数");  //           double d = Convert.ToDouble(Console.ReadLine());  //           Console.WriteLine("请在输入一个运算符号(+,-,*,/)");  //           string y=Convert.ToString(Console.ReadLine());  //           double x = 0;              //               switch (y)  //    {               case "+":  //                       x=c+d;  //        break;  //                   case "-":  //                       x=c-d;  //                       break;  //                   case "*":  //                       x=c*d;  //                       break;  //                   case "/":  //                       x=c/d;  //                       break;  //       default:  //                       Console.WriteLine("你输入的有错误");  //break;  //    } Console.WriteLine(x);  //               Console.ReadLine();

  • 相关阅读:
    字符设备驱动程序
    内存管理
    在React中使用context来传递属性
    iTerm2保存登录密码
    Mac OS设置终端 autocomplete 大小写不敏感
    Linux下安装Google SDK 配置Google API翻译环境
    使用Shell远程给Linux安装JDK
    Linux下wget命令 指定下载文件路径
    linux下解压/压缩命令
    获取鼠标在屏幕上的位置
  • 原文地址:https://www.cnblogs.com/m123/p/4310683.html
Copyright © 2011-2022 走看看