Cod sursa(job #1294756)

Utilizator LegionHagiu Stefan Legion Data 18 decembrie 2014 07:40:43
Problema Text Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include <fstream>
using namespace std;

int main()
{
    ifstream in("text.in");
    ofstream out("text.out");
    char s;
    int i,cuv=0,t=0;
    bool a;
        a=false;
    while (!in.eof())
    {
         in>>s;
         if ((s>='A'&&s<='Z')||(s>='a'&&s<='z'))
         {
             t++;
             a=true;
         }
         else
         {

             if(a)cuv++;
             a=false;
         }
    }
    out<<(int)t/cuv;
    in.close();
    out.close();
    return 0;
}