d008: 求两数的整数商 和 商
内容:
输入说明:
输出说明:
输入样例:
12 8
输出样例 :
1 1.50
#include <stdio.h>
int main(void)
{
float num1 = ;
float num2 = ;
scanf("%f %f", &num1, &num2);
printf("%d %.2f", (int)(num1 / num2), num1 / num2);
return ;
}
或者
#include <stdio.h>
int main(void)
{
int num1, num2;
scanf("%d %d", &num1, &num2);
printf("%d %.2f", num1 / num2, 1.0*num1 / num2);
return ;
}
d008: 求两数的整数商 和 商的更多相关文章
- d007: 求两数的整数商 和 余数
内容: 求两数的整数商 和 余数 输入说明: 一行两个整数 输出说明: 一行两个整数 输入样例: 18 4 输出样例 : 4 2 #include <stdio.h> int main ...
- c++作业:输入两个整数,用函数求两数之和。函数外部声明有什么作用?
#include <iostream> using namespace std; int main(){ //求两数的和? int a,b,s; cout<<"请你输 ...
- 【c语言】不用大与小与号,求两数最大值
// 不用大与小与号,求两数最大值 #include <stdio.h> int max(int a, int b) { int c = a - b; int d = 1 << ...
- c++ question 003 求两数大者?
#include <iostream>using namespace std; int main(){ //求两数中的大者? int a,b; cin>>a>>b; ...
- 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 ...
- ✡ 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 ...
随机推荐
- BZOJ1782: [Usaco2010 Feb]slowdown 慢慢游
1782: [Usaco2010 Feb]slowdown 慢慢游 Time Limit: 1 Sec Memory Limit: 64 MBSubmit: 541 Solved: 326[Sub ...
- Sublime 2 Installation for Linux
Linux You can download the package and uncompress it manually. Alternatively, you can use the comman ...
- 自定义VIew——漂亮的圆形进度条
package com.example.firstapp; import java.text.DecimalFormat; import android.annotation.SuppressLint ...
- java创建XML及开源DOM4J的使用
java import java.io.File; import java.io.StringWriter; import javax.xml.parsers.DocumentBuilder; imp ...
- JNI- java.lang.UnsatisfiedLinkError: Native method not found
http://stackoverflow.com/questions/24566127/jni-java-lang-unsatisfiedlinkerror-native-method-not-fou ...
- [RxJS] Creation operators: empty, never, throw
This lesson introduces operators empty(), never(), and throw(), which despite being plain and void o ...
- crtmpserver 基本流程分析
近期在研究crtmpserver,这里记录下学习过程,首先我们先分析下基本流程. 1.初始化流程 InitNetworking---初始化网络 Initialize Logger::Init()--- ...
- 隐藏Activity标题栏
<span style="font-size:18px;"> </span> 要让Activity的标题栏不被显示的情况分两种: 一.不显示标题栏的不论什么 ...
- struts2,hibernate,spring整合笔记(3)
struts2,hibernate,spring整合笔记(1) struts2,hibernate,spring整合笔记(2) 配好struts和hibernate就要开始spring了 老规矩,还是 ...
- 在Mac中安装.Net Core的开发环境
在mac中部署dotnet core开发环境,我的MacOS版本号为OSX EI Capitan 10.11.6 1.安装brew homebrew官网推荐的安装命令如下: /usr/bin/ruby ...