Pagini recente » Cod sursa (job #1001559) | Cod sursa (job #40406) | Cod sursa (job #3178874) | Cod sursa (job #30947) | Cod sursa (job #2295470)
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int rez=0,lit=0;
string text;
while(getline(fin, text)){
for(int i=0; i<text.size(); i++){
if((text[i]>='a' && text[i]<='z') || (text[i]>='A' && text[i]<='Z')){
rez++;
while((text[i]>='a' && text[i]<='z') || (text[i]>='A' && text[i]<='Z') && i<text.size()){
i++;
lit++;
}
}
}
}
fout<<lit/rez;
return 0;
}