Pagini recente » Cod sursa (job #1939619) | Cod sursa (job #639261) | Cod sursa (job #2591877) | Cod sursa (job #658557) | Cod sursa (job #2218170)
#include<iostream>
#include<fstream>
#include<string.h>
using namespace std;
int main()
{ ifstream f("text.in");
ofstream g("text.out");
char s;
long double l=0,nr=0;
bool iuytresxcvbhju =0;
while(f>>noskipws>>s){
//for(int i=0;s;i++){
if(isalpha(s)){
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();
}