Cod sursa(job #1780609)
Utilizator | Data | 16 octombrie 2016 14:09:41 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int L=0,NR=0;
char prec;
char act;
fin>>prec;
if(isalpha(prec))
L++;
while(fin.get(act))
{
if(isalpha(act)==1)
L++;
else
if(!isalpha(prec))
{NR++;}
prec=act;
}
fout<<L/NR;
return 0;
}