وقل ربي زدني علما
09-08-2007, 01:16 AM
سلام عليكم ورحمه الله وبركاته
انه ماحب فكره انو احد يلقني شنو اسوي
احب التعلم
ولكن بهاي البرنامج
لا يوجد لي شيء به اخطاء
ولكن الناتج مايكون نفس المطلوب
وهي حساب عدد الاحرف الموجوده في هذه الجمله
iam a student in unvirsity of bahrin
وانه برنامجي كالتالي
#include <iostream>
#include <fstream>
using namespace std;
int main ( )
**
ifstream indata;
char ch1,ch2;
char ch;
int count ;
indata.open ("Input.txt");
indata.get (ch1);
cout<<"Enter the character:"<<endl;
cin>>ch;
count=0;
while (indata.eof())
**
indata>>ch;
if (ch1!=ch2)
continue;
cout<<"The letter"<<ch<<"repeated"<<count<<"time(s)"<<endl;
indata>>ch;
count++;
}
indata.close ();
return 0;
}
فهل تلقون بنظره على الخلل الي فيه
وشكرا لكم مقدما
دمتم بود
انه ماحب فكره انو احد يلقني شنو اسوي
احب التعلم
ولكن بهاي البرنامج
لا يوجد لي شيء به اخطاء
ولكن الناتج مايكون نفس المطلوب
وهي حساب عدد الاحرف الموجوده في هذه الجمله
iam a student in unvirsity of bahrin
وانه برنامجي كالتالي
#include <iostream>
#include <fstream>
using namespace std;
int main ( )
**
ifstream indata;
char ch1,ch2;
char ch;
int count ;
indata.open ("Input.txt");
indata.get (ch1);
cout<<"Enter the character:"<<endl;
cin>>ch;
count=0;
while (indata.eof())
**
indata>>ch;
if (ch1!=ch2)
continue;
cout<<"The letter"<<ch<<"repeated"<<count<<"time(s)"<<endl;
indata>>ch;
count++;
}
indata.close ();
return 0;
}
فهل تلقون بنظره على الخلل الي فيه
وشكرا لكم مقدما
دمتم بود