Cod sursa(job #1469833)

Utilizator lraduRadu Lucut lradu Data 9 august 2015 18:02:06
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.63 kb
#include <iostream>
#include <fstream>
#include <algorithm>
#include <math.h>
#include <string>
#include <vector>
#include  <stdio.h>
#define LL long long
using namespace std;
char s;
ofstream f;
ifstream g;

int main()
{
    f.open("text.out");
    g.open("text.in");
    int cnt=0,w=0;
    bool ok=false;
    while (g.get(s))
    {
        if ((s-'0'>16 && s-'0'<43) || (s-'0'>48 && s-'0'<75))
        {
            cnt++;
            ok=true;
        }

        else if (ok)
        {
                w++;
                ok=false;
        }
    }
    if(ok)
        w++;
    f<<cnt/w;
    return 0;
}