#include <iostream>
using namespace std;

int main(){
//求两数中的大者?
int a,b;
cin>>a>>b;
if(a>b)
cout<<"The max number is:"<<a;
else
cout<<"The max number is:"<<b;
}

method two:

#include <iostream>
using namespace std;

int main(){
//求两数中的大者?
int a,b,max;
cin>>a>>b;
if(a>b)
max=a;
else
max=b;
cout<<"The max number is:"<<max;
}

c++ question 003 求两数大者?的更多相关文章

  1. d008: 求两数的整数商 和 商

    内容: 求两数的整数商 和 商 ,商保留两位小数 输入说明: 一行 两个整数 输出说明: 一行,一个整数,一个实数(两位小数) 输入样例:   12 8 输出样例 : 1 1.50 #include ...

  2. d007: 求两数的整数商 和 余数

    内容: 求两数的整数商 和 余数 输入说明: 一行两个整数 输出说明: 一行两个整数 输入样例:   18 4 输出样例 : 4 2 #include <stdio.h> int main ...

  3. 【c语言】不用大与小与号,求两数最大值

    // 不用大与小与号,求两数最大值 #include <stdio.h> int max(int a, int b) { int c = a - b; int d = 1 << ...

  4. c++程序设计第三版例题1.2 求两数的和

    #include <iostream>using namespace std; int main(){ //求两数之和 int a,b,sum; a=11; b=22; sum=a+b; ...

  5. C 语言实例 - 求两数最小公倍数

    C 语言实例 - 求两数最小公倍数 用户输入两个数,其这两个数的最小公倍数. 实例 - 使用 while 和 if #include <stdio.h> int main() { int ...

  6. C 语言实例 - 求两数的最大公约数

    C 语言实例 - 求两数的最大公约数 用户输入两个数,求这两个数的最大公约数. 实例 - 使用 for 和 if #include <stdio.h> int main() { int n ...

  7. c++作业:输入两个整数,用函数求两数之和。函数外部声明有什么作用?

    #include <iostream> using namespace std; int main(){ //求两数的和? int a,b,s; cout<<"请你输 ...

  8. ✡ leetcode 167. Two Sum II - Input array is sorted 求两数相加等于一个数的位置 --------- java

    Given an array of integers that is already sorted in ascending order, find two numbers such that the ...

  9. 【leetcode74】Sum of Two Integers(不用+,-求两数之和)

    题目描述: 不用+,-求两个数的和 原文描述: Calculate the sum of two integers a and b, but you are not allowed to use th ...

随机推荐

  1. 入侵检测系统 - ossec

    http://www.cnblogs.com/zlslch/p/8512757.html

  2. image在div中有留白如何解决

    解决办法: 1. 将img图片display:block,即可去掉div和img之间的空白: 2. 将div的line-height设置得足够小,也可以去掉空白,例如div{line-height:5 ...

  3. Windows 新增 Sublime Text3 右键快捷方式

    Win10 创建 Sublime Text 3 右键快捷方式 Windows + R 输入 regedit 打开注册表编辑器: 依次找到 计算机\HKEY_CLASSES_ROOT\*\shell: ...

  4. Spring学习(二)Spring的bean管理(XML)

    Bean的实例化方式 1.在Spring里面通过配置文件创建对象 2.bean实例化的三种方式第一种:使用类的无参数构造函数创建(最常用的方式,第2种和第3种方法一般不用) 如果类里面没有无参的构造函 ...

  5. LeetCode 583 Delete Operation for Two Strings 删除两个字符串的不同部分使两个字符串相同,求删除的步数

    Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 t ...

  6. JMeter tomcat测试请求

    JMeter tomcat测试请求 Apache Jmeter是开源的压力测试工具,可以测试tomcat 的吞吐量等信息 下载地址: http://jmeter.apache.org/download ...

  7. Java学习笔记--字符串和文件IO

    1.Java中的字符串类和字符的表示 2.区分String,StringBuilder和StringBuffer 3.从命令行中给main方法传递参数 4.文件操作 1 Java中的字符串和字符 1. ...

  8. Java 记录日志

    Java9的日志级别: ALL 最低级别,系统会输出所有的日志信息,会生成大量的·.冗余的日志 TRACE 输出系统的各种跟踪信息,会生成大量的·.冗余的日志 DEBUG 输出调试信息,会生成较多的日 ...

  9. hibernate课程 初探单表映射2-6 session详解(下)

    本节主要内容: 1 介绍了getCurrentSession和opensession的区别 2 demo:通过打印比较两个session是否相同,验证两个session是否是同一session 3 d ...

  10. cf314E. Sereja and Squares(dp)

    题意 题目链接 给你一个擦去了部分左括号和全部右括号的括号序列,括号有25种,用除x之外的小写字母a~z表示.求有多少种合法的括号序列.答案对4294967296取模.合法序列不能相交,如()[],( ...