Cod sursa(job #1572224)
Utilizator | Data | 18 ianuarie 2016 20:08:56 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include<fstream>
#include<cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s;
int lung,cuv,ok;
int main(){
while( fin.get(s) ){
if( ( 'A' <= s && s <= 'Z' ) || ( 'a' <= s && s <= 'z' ) ){
lung++;
ok = 1;
}else{
if( ok == 1 ){
cuv++;
ok = 0;
}
}
}
fout << lung/cuv;
return 0;
}