Pagini recente » Cod sursa (job #809378) | Istoria paginii runda/marinela | Cod sursa (job #2545382) | Cod sursa (job #1407791) | Cod sursa (job #2218160)
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
int main()
{ ifstream f("text.in");
ofstream g("text.out");
char s[1000001];
float l=0,nr=0;
bool iuytresxcvbhju =0;
while(f.getline(s,1000000)) for(int i=0;s[i];i++){
if(isalpha(s[i])){
l++;
iuytresxcvbhju=1;
}
else if(iuytresxcvbhju){// daca precedentul a fost litera
iuytresxcvbhju=0;
nr++;
}
}
if(iuytresxcvbhju) nr++;
if(nr!=0)g<<l/nr<<endl;
else g<<0;
f.close();
g.close();
}