CJCoding With Joseph
15free / daySign inCreate account

Sum and Average of Three Integers

Read three whole numbers separated by spaces from standard input. Compute their sum and their average, then print a line in the exact form Sum: S, Average: A where S is the integer sum and A is the average shown to two decimal places. The twist: dividing by 3 must use floating-point math (divide by 3.0), or the average will be truncated to a whole number.

Expected Output:

Sum: 12, Average: 4.00

= newline. No newline after the last line.

Hints3 available
Topics:
User Input
📥 Auto-Input:
3 4 5\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.