C/C++ Programming Learning-Week 21 ② Four arithmetic operations 1

Topic link

Title description

Read in three numbers a, b, c and output the value of a * (b + c-a)

Input
three numbers a, b, c, separated by spaces

Output
output operation result

Sample Input

1 2 4

Sample Output

5

Ideas

Read in three numbers a, b, c and output the value of a * (b + c-a)

C++ code:

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

Guess you like

Origin blog.csdn.net/qq_44826711/article/details/113551680