Pagini recente » Cod sursa (job #94113) | Cod sursa (job #1648081) | Cod sursa (job #2621875) | Cod sursa (job #1687404) | Cod sursa (job #730942)
Cod sursa(job #730942)
#include <fstream>
#include <cctype>
using namespace std;
int main(){
ifstream fin("text.in");
ofstream fout("text.out");
unsigned lungtot=0,nrof=0;
bool sf=true;
while(!fin.eof()){
char ch;
fin.get(ch);
if(isalpha(ch)){
lungtot++;
if(sf){nrof++;sf=false;}
}
else sf=true;
}
fout<<lungtot/nrof;
fout.close();
fin.close();
return 0;
}