Cod sursa(job #1762178)
Utilizator | Data | 23 septembrie 2016 13:07:57 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream fin ("text.in");
ofstream fout ("text.out");
char c;
long k,cuv,l;
l=0;
k=0;
cuv=0;
while(fin.get(c))
{
if((c>='a'&c<='z')||(c>='A'&c<='Z'))
{
l++;
k++;
if(k==1)
cuv++;
}
else k=0;
}
if(cuv!=0)
fout<<l/cuv<<"\n";
else fout<<"0"<<"\n";
return 0;
}