Cod sursa(job #730942)
Utilizator | Arnold Beiland BeilandArnold | Data | 7 aprilie 2012 09:54:57 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#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;
}