Cod sursa(job #2082271)
Utilizator | Data | 5 decembrie 2017 21:37:57 | |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <iostream>
#include <fstream>
#include <cstring>
#include <cctype>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s;
int n_lit, n_cuv;
int main()
{
while(f.get(s))
{
if(isalpha(s))
{
n_lit++;
}
else n_cuv++;
}
if(n_cuv) g << n_lit/n_cuv;
else g << 0;
}