课后练习1.

1.三个数中选最大值

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication18
{
class Program
{
static void Main(string[] args)
{
Console.Write("");
int a = int.Parse(Console.ReadLine());

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

Console.Write("");
int c = int.Parse(Console.ReadLine());

if (a > b && b > c)
{
Console.WriteLine("三个数中最大的数为: +a");
}
if (a < b && b < c)
{
Console.WriteLine("三个数中最大的数为: +c");
}
if (a < b && b > c)
{
Console.WriteLine("三个数中最大的数为: +b");
}

Console.ReadLine();
}

}
}

时间: 2024-08-06 07:58:45

课后练习1.的相关文章

问题 1018: C语言程序设计教程(第三版)课后习题6.8

/******************************************************************** @file Main.cpp @date 2017-05-12 @author Zoro_Tiger @brief 问题 1018: C语言程序设计教程(第三版)课后习题6.8 http://www.dotcpp.com/oj/problem1018.html *************************************************

问题 1041: C语言程序设计教程(第三版)课后习题9.8

/******************************************************************** @file Main.cpp @date 2017-05-28 22:02:55 @author Zoro_Tiger @brief 问题 1041: C语言程序设计教程(第三版)课后习题9.8 http://www.dotcpp.com/oj/problem1041.html ****************************************

问题 1040: C语言程序设计教程(第三版)课后习题9.6

/******************************************************************** @file Main.cpp @date 2017-05-28 21:57:02 @author Zoro_Tiger @brief 问题 1040: C语言程序设计教程(第三版)课后习题9.6 http://www.dotcpp.com/oj/problem1040.html ****************************************

问题 1042: C语言程序设计教程(第三版)课后习题9.10

/******************************************************************** @file Main.cpp @date 2017-05-28 22:10:10 @author Zoro_Tiger @brief 问题 1042: C语言程序设计教程(第三版)课后习题9.10 http://www.dotcpp.com/oj/problem1042.html ***************************************

问题 1023: C语言程序设计教程(第三版)课后习题7.2

/******************************************************************** @file Main.cpp @date 2017-05-20 22:05:39 @author Zoro_Tiger @brief 问题 1023: C语言程序设计教程(第三版)课后习题7.2 http://www.dotcpp.com/oj/problem1023.html ****************************************

问题 1008: C语言程序设计教程(第三版)课后习题5.6

/******************************************************************** @file Main.cpp @date 2017-5-8 @author Zoro_Tiger @brief 问题 1008: C语言程序设计教程(第三版)课后习题5.6 http://www.dotcpp.com/oj/problem1008.html ***************************************************

问题 1006: C语言程序设计教程(第三版)课后习题5.4

/******************************************************************** @file Main.cpp @date 2017-05-07 @author Zoro_Tiger @brief 问题 1006: C语言程序设计教程(第三版)课后习题5.4 http://www.dotcpp.com/oj/problem1006.html *************************************************

课后作业

课后作业 "类型转换"知识点考核-2 程序源代码: 1 class Mammal{} 2 class Dog extends Mammal {} 3 class Cat extends Mammal{} 4   5 public class TestCast 6 { 7      public static void main(String args[]) 8      { 9             Mammal m; 10             Dog d=new Dog();

第四讲课后题

本讲主要学习了静态类的使用方法: 1.使用类的静态字段和构造函数,我们可以跟踪某个类所创建对象的个数.请写一个类,在任何时候都可以向它查询"你已经创建了多少个对象?". 代码: 1 package 课后四讲; 2 3 import javax.swing.JOptionPane; 4 5 class Example 6 { 7 static int value=0; 8 public Example() 9 { 10 value++; 11 12 } 13 } 14 public cl

小甲鱼python视频第三讲(笔记及课后习题答案)

1.变量命名的规则: 1.变量在使用前要赋值. 2变量可以是字母.下划线.数字,但不能以数字开头. 3变量中要区分大小写,其代表的含义不一样. PS:在python中,只是把值贴到变量中,而不是存储,所以在python中可以认为没有变量. 2.字符串 在使用字符串是要注意前后一致 PS:字符串中关于引号的使用 'let\'s go' 结果为 3.反斜杠的使用 str = "C:\file" print str str = "C:\\file" print str s