跳到正文

题解

B2008 计算 (a+b)×c 的值

Eason_AC约 1 分钟
原文
文章信息与版本

文章信息

发布
2021年7月3日
收录
2026年11月29日
更新
2026年11月29日
篇幅
约 1 分钟
获赞
7
题目
B2008

版本

  1. v1当前

Content

输入 a,b,ca,b,c,输出 (a+b)×c(a+b)\times c。

数据范围:−10000<a,b,c<10000-10000<a,b,c<10000。

Solution

关于 C++ 运算顺序可以看这篇题解,所以,直接 printf("%d", (a + b) * c); 即可。

Code

C++
#include <cstdio>
using namespace std;

int main() {
	int a, b, c;
	scanf("%d%d%d", &a, &b, &c);
	printf("%d", (a + b) * c);
	return 0;
}
原文
抓取于
  1. wjw13236247199

    666

  2. SClan_Official

    #include <cstdio> int main(int a,int b,int c){return scanf("%d%d%d",&a,&b,&c),printf("%d",(a+b)*c),0;}

  3. ling_yun

    orz