Mar-21-2017, 05:53 PM
I'm working on my homework for my programming class and I am honestly just stuck on one problem. The only thing I have so far is the prompt for user input.
Write a program that reads a sequence of integer inputs and print
a) The smallest and largest of the inputs.
b) The number of even and odd inputs.
c) Cumulative totals. For example, if the input is 1 7 2 9, the program should print
1 8 10 19.
d) All adjacent duplicates. For example, if the input is 1 3 3 4 5 5 6 6 6 2, the
program should print 3 5 6.
I have to write a code that will allow for user input of a sequence of numbers and print them accordingly to these four guidelines.
If anyone could help me write a code and even explain it to me it would be much appreciated :D
Write a program that reads a sequence of integer inputs and print
a) The smallest and largest of the inputs.
b) The number of even and odd inputs.
c) Cumulative totals. For example, if the input is 1 7 2 9, the program should print
1 8 10 19.
d) All adjacent duplicates. For example, if the input is 1 3 3 4 5 5 6 6 6 2, the
program should print 3 5 6.
I have to write a code that will allow for user input of a sequence of numbers and print them accordingly to these four guidelines.
If anyone could help me write a code and even explain it to me it would be much appreciated :D