Cod sursa(job #1976583)
Utilizator | Data | 3 mai 2017 19:55:45 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.6 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream F("text.in");
ofstream G("text.out");
int cuv, kcuv, klit, n;
char c;
int main()
{
while(F)
{
F.get(c);
{
if((c >= 'a' && c<= 'z') || (c >= 'A' && c <= 'Z'))
{
if(!cuv)
++kcuv, cuv = 1;
++ klit;
}
else
{
if(cuv)
cuv = 0;
}
}
}
if(!kcuv)
G << "0";
else
G << klit / kcuv;
return 0;
}