اخواني أخواتي أعضاء هذا المنتدى الرائع ,,
لو سمحتوا بغيت فزعتكم في حل هذين التمرينين اللي لاقيت صعوبة في حلهم ..[/
Exercise 1 (3Points)
Write a program that finds the two largest and two smallest integers in a file that’s filled with numerical values. The input should be read from a file numbers.dat, and the output should be displayed to the screen as well as written to a file named stats.dat. (Hint: before you start, read all you can about EOF-controlled loops in your textbooks)
The format of the input is as follows:
n1 n2 n3 n4 …
The format of the output is as follow:
The file contains ??? numbers
The two largest values in the list are: … …
The two smallest values in the list are: … …
Exercise 2 (3 Points):
A sequence of numbers is monotonic increasing if the values are in sorted order, that is, they are arranged in an increasing order. For example, 1, 1, 3, 4, 9 is a monotonic sequence, but 1, 3, 2, 4, 9 is not a monotonic sequence because 3 is greater than 2.
Write a program that determines whether an input sequence is in monotonic increasing order.
Write a program that finds the two largest and two smallest integers in a file that’s filled with numerical values. The input should be read from a file numbers.dat, and the output should be displayed to the screen as well as written to a file named stats.dat. (Hint: before you start, read all you can about EOF-controlled loops in your textbooks)
The format of the input is as follows:
n1 n2 n3 n4 …
The format of the output is as follow:
The file contains ??? numbers
The two largest values in the list are: … …
The two smallest values in the list are: … …
Exercise 2 (3 Points):
A sequence of numbers is monotonic increasing if the values are in sorted order, that is, they are arranged in an increasing order. For example, 1, 1, 3, 4, 9 is a monotonic sequence, but 1, 3, 2, 4, 9 is not a monotonic sequence because 3 is greater than 2.
Write a program that determines whether an input sequence is in monotonic increasing order.
وأرجو أنا لا تبخلو علي بالرد ... جزاكم الله خير ..
أختكم : م. أمل
أختكم : م. أمل