Pagini recente » Cod sursa (job #2658907) | Cod sursa (job #1345563) | Cod sursa (job #3128199) | Cod sursa (job #824604) | Cod sursa (job #742808)
Cod sursa(job #742808)
#include<fstream>
using namespace std;
int main()
{
char text[5000];
int i,cv=1,cif=0;
ifstream f("text.in");
ofstream g("text.out");
f.getline(text,5000);
for(i=1;i<=strlen(text);i++)
{
if(text[i]>='a' && text[i]<='z' || text[i]>='A' && text[i]<='Z')
cif++;
if(text[i]>='a' && text[i]<='z' || text[i]>='A' && text[i]<='Z' || text[i]==',' || text[i]=='.')
if(text[i+1]==' ' || text[i+1]=='-')
cv++;
}
g<<cif/cv;
f.close();
g.close();
return 0;
}