Cod sursa(job #2609259)
Utilizator | Data | 2 mai 2020 12:58:27 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | igorj_mentorat1 | Marime | 0.44 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s;
int medie,cate;
bool ok;
int main()
{
while(f >> noskipws >> s)
{
if(isalpha(s))
{
++ medie;
if(!ok)
++ cate;
ok = 1;
}
else
ok = 0;
}
if(!cate)
g << 0;
else
g << medie / cate;
}