Cod sursa(job #1121528)

Utilizator lunguandreiLungu Andrei lunguandrei Data 25 februarie 2014 13:08:18
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include<iostream>
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int sum,k,p;
char c;
int main()
{
    while(f.get(c))
    {

       {if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
        k++;
     else
        {if(k!=0)
         sum++;
         p=p+k;
         k=0;}
       }
    }
    g<<p/sum;
    f.close();
    g.close();
    return 0;
}