I know it is a simple mistake but I can't see it ...
You know when somebodays brain stoped.....
this is the file ...
#include<iostream>
#include<string.h>
int main()
{
string str1;
int i=0;
int j=0;
int counterwords =1;
cout<< "Please input your text string... \n";
cin>> str1;
while (str1[i]<>0)
{
i++;
if (str1[i] == " ")
{
counterwords++;// how many words we have here
}
if (str1[i] <>( ' '|| ',' || ';' || '.' ||'!' || '?' ))
{
j++;// how many charactors that the lines have
}
}// while
int ave =0;
ave = j div counterwords ;// what is the avarage of the words in this line...
cout<< " the number of words that you have intered is :" << counterwords<<endl;
cout<< "the number of the char that you have is :"<< j<< endl;
cout<< " the avarage of the word lingth is :" << ave << endl;
return 0;
}
_____________
Please chick it up/
![]()
![]()
I am drank
Thnx![]()



LinkBack URL
About LinkBacks




new Drunker.....