Cod sursa(job #1464429)
| Utilizator | Data | 23 iulie 2015 15:31:41 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <iostream>
#include <fstream>
using namespace std;
main()
{
ifstream f1("text.in");
ofstream f2("text.out");
char ch;
int n=0, cuv=0, k=0;
while (!f1.eof())
{
f1 >> ch;
if (((ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122)) && k == 1)
n++;
if (((ch >= 65 && ch <= 90) || (ch >= 97 && ch <= 122)) && k == 0)
{
k = 1;
cuv++;
n++;
}
}
f2<<n/cuv;
f1.close();
f2.close();
}
