Pagini recente » Cod sursa (job #2912956) | Profil Mihaela_Narita | Cod sursa (job #3287250) | Atasamentele paginii oni2018ziua1 | Cod sursa (job #2218150)
#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.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
nr++;
iuytresxcvbhju=0;
}
if(iuytresxcvbhju) nr++;
if(nr!=0)g<<l/nr<<endl;
else g<<0;
f.close();
g.close();
}