#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. promise封装小程序的蓝牙类

    // pages/bluetooth/bluetooth.js import { BluetoothMode } from '../../models/bluetooth.js' import {Sy ...

  2. 今天实现一个T-sql的小编程,分享给大家,看看就好~(列值赋值)

    介绍:将一个表的某列值插入到另一个表的列里,暂定为表aa和表nn DECLARE @a int set @a=1 while @a<nn.列1.length    --(注:语法不对你可以用查询 ...

  3. 1、kvm的vnc服务关闭、设置网络模式

    一.kvm的vnc服务关闭 1.关闭虚拟机 virsh shutdown privi-server 2.virsh edit privi-server找到下面内容进行删除 <graphics t ...

  4. wms-springmvc-servlet.xml

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  5. Win7 桌面图标消失

    win7 桌面图标消失或任务栏也消失,可以按Ctrl+Shift+Esc键调出任务管理器,然后点击文件——新建任务,输入explorer.

  6. Java中如何实现代理机制(JDK动态代理和cglib动态代理)

    http://blog.csdn.net/skiof007/article/details/52806714 JDK动态代理:代理类和目标类实现了共同的接口,用到InvocationHandler接口 ...

  7. POJ 3304 Segments 判断直线和线段相交

    POJ 3304  Segments 题意:给定n(n<=100)条线段,问你是否存在这样的一条直线,使得所有线段投影下去后,至少都有一个交点. 思路:对于投影在所求直线上面的相交阴影,我们可以 ...

  8. Maven的学习资料收集--(九) 构建SSH项目以及专栏maven

    在这里整合一下,使用Maven构建一个SSH项目 1.新建一个Web项目 可以参照前面的博客 2.添加依赖,修改pom.xml <project xmlns="http://maven ...

  9. xcrun -sdk 选择

    在将FFmpeg编译成IOS版的时候,接触到编译脚本的一段(删减了部分): for ARCH in $ARCHS do if [ "$ARCH" = "i386" ...

  10. java向上取整向下取整

    向上取整用Math.ceil(double a) 向下取整用Math.floor(double a) 举例: public static void main(String[] args) throws ...