Cod sursa(job #2072088)
Utilizator | Data | 21 noiembrie 2017 13:04:48 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include<bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int nr,nr2;
main(){
char c;
int ok=0;
while(f.get(c)){
if(isalpha(c)){
nr2++;
if(!ok){
nr++;
ok=1;
}
}
else {
ok=0;
}
}
if(nr==0)g<<0;
else
g<<int(nr2/nr);
}