الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

[تنبيه]الفزعة الفزعة يا خبراء ++C

مغلق
بدأه م. أمل في 24 مارس 2007 · 6 رد · 1,879 مشاهدة · في C++.Net
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ورحمة الله وبركاته

اخواني أخواتي أعضاء هذا المنتدى الرائع ,,

لو سمحتوا بغيت فزعتكم في حل هذين التمرينين اللي لاقيت صعوبة في حلهم ..[/

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.

وأرجو أنا لا تبخلو علي بالرد ... جزاكم الله خير ..

أختكم : م. أمل

#2

السلام عليكم

اول شي انت شغالةعلى السي دوت نت صح ؟ مو السي visula c++ 6

طيب شو رايك تفرجينا كيف بلشتي و بنكمل سوا

لانه من شروط الاجابه انك تفرجينا محاولاتك بالسؤال

سلااام

Computer Engineer

2007

"اللهم يا مثبت القلوب ثبت قلبي على دينك "

ولدتك امك باكيا والناس حولك يضحكون سرورا

فافعل لنفسك ان تكون اذا بكوا في يوم موتك ضاحكا مسرورا

#3
white soul كتب:
طيب شو رايك تفرجينا كيف بلشتي و بنكمل سوا

لانه من شروط الاجابه انك تفرجينا محاولاتك بالسؤال

;)

#4

السلام عليكم ورحمة الله وبركاته ..

هــذه هي محاولتي في تمرين 1

#include <iostream>

#include <fstream>

using namespace std;

int main ()

{

int num;

int max=0;

int min=0;

ifstream infile;

ofstream outfile;

infile.open("numbers.dat"); //open the input file

outfile.open("stats.dat"); //open the output file

cout<<"Enter a number";

infile>>num;

while (!infile.eof())

{

if(num>max)

max=num;

else(num<min);

min=num;

infile>>num;

}

cout<<"largest number:";

cout<<max<<endl;

cout<<"smallest number:";

cout<<min<<endl;

// close files

infile.close();

outfile.close();

return 0;

}

#5

أرجو المساعده في الحل بأقرب فرصة جزاكم الله خيرا لأن التسليم سيكون تاريخ 28-3 ..

#6

العنوان غير مناسب

الرجاء اختيار عنوان مناسب أكثر في مواضيعك القادمة، وهذا بمثابة إشعار للأهمية.

وفي حال التكرار سيتعرض موضوعك للإغلاق والحذف!!!

قواعد المشاركة

/index.php?showtopic=29343

لا إله إلا الله محمد رسول الله

busbar : يجب ان تدرك انه هناك حد ادنى للمعرفة المطلوبة قبل البدء في عمل أي شئ.

#7

اعتقد اني جيت بوقت متأخر

سامحوني

هذا الموضوع مغلق.

مواضيع مشابهة