Question: in c + + MetricSmallest Diff Write a program in SmallestDiff / main . cpp that reads trios of integers from the standard input stream

in c++
MetricSmallest Diff
Write a program in SmallestDiff/main.cpp that reads trios of integers from
the standard input stream until there are no more values. For each trio, print
the smallest difference between the three. For example, if the three
numbers are 1,10, and 100, the smallest difference is 9(10-1), as (100-
and (100-10) are both larger than 9.
Example input:
1,10,100
7,14,7
900,899,876
8,764,10
Expected output:
The smallest diff of 1,10, and 100 is 9.
The smallest diff of 7,14, and 7 is .
The smallest diff of 900,899, and 876 is 1.
The smallest diff of 8,764, and 10 is 2.
Write a program in Metric/main.cpp that reads pairs of metric distances
(mm,cm,m, or km ) from the standard input stream until there are no more
values. For each pair, print if the first distance is larger than the second.
Example input:
10mm 14mm
14mm 10mm
12mm 12mm
1cm 10mm
12cm 99mm
12cm 200mm
1km 5677m
100000cm 1000m
Expected output:
10mm is smaller than 14mm
14mm}\mathrm{ is larger than 10mm
12mm}\mathrm{ is the same as 12mm
1cm}\mathrm{ is the same as 10mm
12cm}\mathrm{ is larger than 99mm
12cm}\mathrm{ is smaller than 200mm
1km}\mathrm{ is smaller than 5677m
100000cm is the same as 1000m
in c + + MetricSmallest Diff Write a program in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!