Cod sursa(job #1124791)

Utilizator bogdanboboc97Bogdan Boboc bogdanboboc97 Data 26 februarie 2014 13:46:49
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include<iostream>
#include<fstream>
#include<string.h>

using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");

int lt,cuv,t;
char c;

int main()
{
	while(fin.get(c))
    {
	if(t==0)
        if(c>='a'&&c<='z'||c>='A'&&c<='Z')
            t=1;
    if(t==1)
       if(c>='a'&&c<='z'||c>='A'&&c<='Z')
            lt++;
        else
		{
			cuv++;
            t=0;
		}
	}
	fout<<lt/cuv;
}