02:计算(a+b)*c的值

OpenJudge-1.3编程基础之算术表达式与顺序执行-02:计算(a+b)*c的值
总Time Limit: 1000ms     Memory Limit: 65536kB

Description

给定3个整数a、b、c,计算表达式(a+b)*c的值。

Input

输入仅一行,包括三个整数a、b、c, 数与数之间以一个空格分开。
(-10,000 < a,b,c < 10,000)

Output

输出一行,即表达式的值

Sample Input

2 3 5

Sample Output

25

Source

习题(3-3) 计算概论B 2010

C++ Code

#include <bits/stdc++.h>
using namespace std;
int main()
{
      int a,b,c;
      cin>>a>>b>>c;
      cout<<(a+b)*c;
      return 0;
}

C Code

#include <stdio.h>
int main()
{
      int a,b,c;
      scanf("%d%d%d",&a,&b,&c);
      printf("%d",(a+b)*c);
      return 0;
}
posted @ 2020-08-06 17:06  Programmer-sun  阅读(807)  评论(0编辑  收藏  举报