Task - Vlad wants to bring a couple of fruit for lunch. He has a different bananas, b different apples and c different pears. In how many ways can he select 2 different fruits from his?
Input There are three non-negative numbers in one line: a, b, c. All numbers do not exceed 10 6 .
Specifications Input Display the number of ways that you can choose 2 fruits of different types.
Code
#include <iostream> using namespace std; int main() { int a,b,c; cin >>a>>b>>c; int n=a*b+a*c+b*c; cout<<n; } On e-olymp gives only 85%, what's wrong with the code?
if(n<0)n=-n;- what is this garbage? - Igor