Cod sursa(job #2835041)
| Utilizator | Data | 17 ianuarie 2022 23:20:41 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.58 kb |
#include<bits/stdc++.h>
using namespace std;
FILE *fin=fopen("text.in","r");
ofstream fout("text.out");
bool verif (char c)
{
if ((c>='a' &&c<='z')|| (c>='A' &&c<='Z'))
return 1;
return 0;
}
int32_t main()
{
int i,lit=0,cuv=0;
char c,pred;
fscanf(fin,"%c",&pred);
if (verif (pred))
lit++,cuv++;
while(fscanf(fin,"%c",&c)!=EOF)
{
if (verif(c))
{
lit++;
if (verif(pred)==0)
cuv++;
}
pred=c;
}
if (cuv==0)
fout<<0;
else fout<<lit/cuv;
}
