Cod sursa(job #1386149)

Utilizator DobosDobos Paul Dobos Data 12 martie 2015 18:47:03
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
   char x;
   int n=0,c=0;
   while(f.get(x))
   {
       if((x >= 'A' && x<='Z') || (x >= 'a' && x <= 'z') )
       {
           n++;
           while(f.get(x) && x != '\n' && (x >= 'A' && x<='Z') || (x >= 'a' && x <= 'z'))
            n++;
           c++;
       }
   }
   g<<n/c;
    return 0;
}