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 ...
随机推荐
- c# log4Net 详细说明
转载 http://www.cnblogs.com/kissazi2/p/3392605.html
- Linux之dstat命令
dstat命令是一个用来替换vmstat.iostat.netstat.nfsstat和ifstat这些命令的工具,是一个全能系统信息统计工具.与sysstat相比,dstat拥有一个彩色的界面,在手 ...
- word2010页脚页码的总页数修改方法
3很多时候做WORD文档时,首页和尾页通常是做为封面与封底的是不做页码统计的. 这时候就需要总页面上减去首页和尾页的数量.以下为修改总页数方法 1.打开WORD文档设置页眉页脚,页脚设置页码, 2.设 ...
- 008 String to Integer (atoi) 字符串转换为整数
详见:https://leetcode.com/problems/string-to-integer-atoi/description/ 实现语言:Java class Solution { publ ...
- LCS(Longest Common Subsequence)
http://blog.csdn.net/zztfj/article/details/6157429 LCS(Longest Common Subsequence) 就是求两个字符串最长公共子串的问题 ...
- UiAutomator新建工程
新建工程步骤: 1.打开Eclipse 2.新建一个java工程UiAutomatorDemo1,然后新建一个包com.hhb 3.选中java工程,右击新建文件夹,命名为libs,在D:\Andro ...
- CentOS6.x之emacs安装配置编译
刚开始学习linux,干学没什么意思,想在linux下写写程序,了解到linux下使用较多的是emacs和vim,在youtobe上分别看了看这两个工具进行开发的视频,个人感觉emacs比较酷一点,所 ...
- 【Unity3D】简要分析unity3d中剪不断理还乱的yield
在学习unity3d的时候很容易看到下面这个例子: void Start () { StartCoroutine(Destroy()); } IEnumerator Destroy(){ yield ...
- 引用 Session详解 作者:郎云鹏
本文转载自leeldy<Session详解 作者:郎云鹏> 引用 leeldy 的 Session详解 作者:郎云鹏 目录: 一.术语session 二.HTTP协议与状态保持 三.理 ...
- struts2 第二天
3.自动装配 零散属性:Action类中两个成员变量的名称和页面上表单元素name属性值保持一致. 规则:约定优于配置. 领域模型:两种配置 public class FirstA ...