Cod sursa(job #1294758)
| Utilizator | Data | 18 decembrie 2014 07:46:25 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <fstream>
#include <iostream>
using namespace std;
int main()
{
ifstream in("text.in");
ofstream out("text.out");
char s;
int i,cuv=0,t=0;
bool a;
a=false;
while (in.get(s))
{
if ((s>='A'&&s<='Z')||(s>='a'&&s<='z'))
{
t++;
a=true;
}
else
{
if(a)cuv++;
a=false;
}
}
out<<t/cuv;
in.close();
out.close();
return 0;
}
