Cod sursa(job #2410535)

Utilizator RazvanucuPopan Razvan Calin Razvanucu Data 20 aprilie 2019 10:07:06
Problema Text Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.4 kb
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int i,j,k,n,nr;
int main()
{
    char a,y='0';
    while(f>>noskipws>>a)
    {if((a>='a' && a<='z') || (a>='A' && a<='Z'))
      n++;
      else
       if((y>='a' && y<='z') || (y>='A' && y<='Z'))
        nr++;
        y=a;
    }

g<<n/nr;

    return 0;
}