c++ question 003 求两数大者?
#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 求两数大者?的更多相关文章
- d008: 求两数的整数商 和 商
内容: 求两数的整数商 和 商 ,商保留两位小数 输入说明: 一行 两个整数 输出说明: 一行,一个整数,一个实数(两位小数) 输入样例: 12 8 输出样例 : 1 1.50 #include ...
- d007: 求两数的整数商 和 余数
内容: 求两数的整数商 和 余数 输入说明: 一行两个整数 输出说明: 一行两个整数 输入样例: 18 4 输出样例 : 4 2 #include <stdio.h> int main ...
- 【c语言】不用大与小与号,求两数最大值
// 不用大与小与号,求两数最大值 #include <stdio.h> int max(int a, int b) { int c = a - b; int d = 1 << ...
- c++程序设计第三版例题1.2 求两数的和
#include <iostream>using namespace std; int main(){ //求两数之和 int a,b,sum; a=11; b=22; sum=a+b; ...
- C 语言实例 - 求两数最小公倍数
C 语言实例 - 求两数最小公倍数 用户输入两个数,其这两个数的最小公倍数. 实例 - 使用 while 和 if #include <stdio.h> int main() { int ...
- C 语言实例 - 求两数的最大公约数
C 语言实例 - 求两数的最大公约数 用户输入两个数,求这两个数的最大公约数. 实例 - 使用 for 和 if #include <stdio.h> int main() { int n ...
- c++作业:输入两个整数,用函数求两数之和。函数外部声明有什么作用?
#include <iostream> using namespace std; int main(){ //求两数的和? int a,b,s; cout<<"请你输 ...
- ✡ 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 ...
- 【leetcode74】Sum of Two Integers(不用+,-求两数之和)
题目描述: 不用+,-求两个数的和 原文描述: Calculate the sum of two integers a and b, but you are not allowed to use th ...
随机推荐
- Oracle插入中文数据乱码 设置服务器编码和客户端编码一致
- JS精粹知识点和我的解释
函数若是不return则默认返回undefined const value=()=>{ let a=3; } let value_test; console.log(value(),value_ ...
- hutool java工具架包功能介绍
https://blog.csdn.net/lx1309244704/article/details/76459718
- 009 Palindrome Number 判断一个正整数是否是回文数
详见:https://leetcode.com/problems/palindrome-number/description/ 实现语言:Java 方法一: class Solution { publ ...
- linkedlist--lecture-4
1.链表数据结构 内存利用率高:动态分配 2.链表类定义 单向链表节点 public calss ListNode { int val =0; ListNode next = null; public ...
- Java面向对象_对象内存分析—值传递和引用传递
对象内存分析,我一直学的比较模糊,今天抽空整理一下,希望能理清. 先说一下,内存分析从何而来,这对于我们这些刚接触java的人来说都比较模糊,就从new关键字说起吧. new关键字表示创建一个对象或者 ...
- [切图仔救赎]炒冷饭--在线手撸vue2响应式原理
--图片来源vue2.6正式版本(代号:超时空要塞)发布时,尤雨溪推送配图. 前言 其实这个冷饭我并不想炒,毕竟vue3马上都要出来.我还在这里炒冷饭,那明显就是搞事情. 起因: 作为切图仔搬砖汪,长 ...
- java 多线程 Callable中的futrue模式
java实现Callable接口中用到了future模式,所以实现了这个接口就看到了有返回值,那它的基本原理是什么鬼,往下看. 何为future模式? future模式有点类似于商品订单.在网上购物时 ...
- prototype 以及 constructor 属性的理解
1 为什么 xx.constructor.prototype 可以访问到当前对象的原型. 'str'.constructor.prototype 'str'.constructor 指向当前 ...
- notepad++上配置ruby执行环境
1.安装NppExec 插件 2.按快捷键F6,在弹出框中输入如下命令: npp_save cd "$(CURRENT_DIRECTORY)" jruby "$(FI ...