1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
Enter three (3) integers: 9 -4 14
The middle of 9, -4, 14 is: 9
Enter three (3) floating point numbers: -3.9 -5 -0.12
The middle of -3.900000, -5.000000, -0.120000 is: -3.900000
Enter three (3) characters: r g j
The middle of r, g, j is: j
// This works as advertised
Enter three (3) integers: 4 4 4
The middle of 4, 4, 4 is: 4
Enter three (3) floating point numbers: 9.0 9 9.0
The middle of 9.000000, 9.000000, 9.000000 is: 9.000000
Enter three (3) characters: r r r
The middle of r, r, r is: r
//Checking the handling of equal values
Enter three (3) integers: 92 askldjf9 1230
The middle of 92, 9, 1230 is: 92
Enter three (3) floating point numbers: 5.9 9hrli 0.dui9
The middle of 5.900000, 9.000000, 0.000000 is: 5.900000
Enter three (3) characters: The middle of d, u, i is: i
//Garbage in the input. Note that 5.9 9. and 0.0 were read as the
//floats, which left "dui9" in the input stream. This was processed
//by the next cin statements.
|