Cod sursa(job #2420620)

Utilizator AndreiAlexandru2k3Ciucan Andrei Alexandru AndreiAlexandru2k3 Data 12 mai 2019 20:41:03
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.4 kb
#include <iostream>
#include <fstream>

using namespace std;

ifstream f("text.in");
ofstream g("text.out");

int main()
{
    char x,y='0';
    int nr=0,sum=0;
    while(!f.eof()){
        f>>noskipws>>x;
        if((x>='a'&&x<='z')||(x>='A'&&x<='Z'))
        sum++;
        else if((y>='a'&&y<='z')||(y>='A'&&y<='Z'))
            nr++;
        y=x;
    }
    g<<sum/nr;
    return 0;
}