Pagini recente » Arhiva de probleme | Cod sursa (job #216239) | Cod sursa (job #2466630) | Cod sursa (job #19681) | Cod sursa (job #2218154)
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
int main()
{ ifstream f("text.in");
ofstream g("text.out");
char s[1000001];
int l=0,nr=0;
bool iuytresxcvbhju =0;
while(!f.get(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++;
g<<l/nr<<endl;
//else g<<0;
f.close();
g.close();
}