网站公告 | 这是第三条公告我的广告
微信扫一扫 分享朋友圈

已有 3323 人浏览分享

1008:计算(a+b)/c的值

[复制链接]

10

主题

2

回帖

12

积分

版主

Rank: 7Rank: 7Rank: 7

积分
12
发表于 2023-10-18 21:11:51 | 显示全部楼层 | 阅读模式 来自 中国山东淄博
[C++] 纯文本查看 复制代码
#include<iostream>
using namespace std;
int main(){
	int a;
	int b;
	int c;
	int d;
	cin>>a>>b>>c;
	d=(a+b)/c;
	cout<<d;
[align=left][size=14px]}

【题目描述】

给定<span class="MathJax" id="MathJax-Element-1-Frame" tabindex="0" data-mathml="3" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; text-wrap: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">3
个整数<span class="MathJax" id="MathJax-Element-2-Frame" tabindex="0" data-mathml="a&#x3001;b&#x3001;c" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; text-wrap: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">a、b、c
,计算表达式<span class="MathJax" id="MathJax-Element-3-Frame" tabindex="0" data-mathml="a+bc" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; text-wrap: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">a+bc的值。


【输入】

输入仅一行,包括三个整数<span class="MathJax" id="MathJax-Element-4-Frame" tabindex="0" data-mathml="a&#x3001;b&#x3001;c" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; text-wrap: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">a、b、c
, 数与数之间以一个空格分开。(<span class="MathJax" id="MathJax-Element-5-Frame" tabindex="0" data-mathml="&#xFF0D;10,000&lt;a,b,c&lt;10,000" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; text-wrap: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px;">-10,000<a,b,c<10,000         <span class="MathJax" id="MathJax-Element-6-Frame" tabindex="0" data-mathml="c" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; text-wrap: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; position: relative;">  c
不等于<span class="MathJax" id="MathJax-Element-7-Frame" tabindex="0" data-mathml="0" role="presentation" style="display: inline; line-height: normal; font-size: 16px; text-indent: 0px; word-spacing: normal; overflow-wrap: normal; text-wrap: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px;">0
)


【输出】

输出一行,即表达式的值。


【输入样例】1 1 3【输出样例】0
回复

使用道具 举报

文明发言,和谐互动
文明发言,和谐互动
懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

0

关注

0

粉丝

10

主题

QQ|手机版|小黑屋|山东智趣岛论坛 ( 鲁ICP备2023024048号 )

GMT+8, 2025-7-4 19:57 , Processed in 0.319144 second(s), 51 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.