Cod sursa(job #2444413)
Utilizator | Data | 31 iulie 2019 15:20:07 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <iostream>
#include<cstring>
#include<fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
char c;
int word=0,letter=0,ok=1;
while(fin.get(c)){
if((c>='a'&&c<='z')||(c>='A'&&c<='Z')) // verific daca "c" e litera
{
letter++;
if(ok==1)
word++;
ok=0;
}
else ok=1;
}
fout<<letter/word;
}