PDA

View Full Version : خطا در برنامه



idan1993
یک شنبه 17 آذر 1392, 19:29 عصر
دوستان اشتباه این کد چیه ؟
#include<iostream.h>
#include<conio.h>
int main()
{

char str[90];
int jomle=0,kalame=0,harf=0,parageraf=0;
cout<<"Enter a Paragraph \n";
cin.get(str,90);
cout<<"Please start your words(enter * for close) : \n";
for(int i=0;str[i]!='*';i++)
{
if(str[i]=='.'||str[i]=='!'||str[i]=='?')
{
jomle++;
kalame++;
}
else if(str[i]==' '||str[i]==',')
kalame++;
else if(str[i]>65&&str[i]<123)
harf++;
else if(str[i]=='\n')
parageraf++;

}
cout << "tedad harf = " << harf << endl;
cout << "tedad words=" << kalame << endl;
cout << "tedad jomle = "<< jomle;
cout << "tedad parageraf = "<< parageraf;
getch();
return 0;
}

abdorreza
یک شنبه 17 آذر 1392, 20:16 عصر
دوست عزیز لطف کن کد ها را بین تگ code بنویس که دیدن و خطایابی راحت باشه!!!!