Cod sursa(job #1028848)

Utilizator buzaturazvanbuzatu marin razvan buzaturazvan Data 14 noiembrie 2013 19:10:46
Problema Text Scor 50
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.52 kb
#include <iostream>
#include <fstream>
#include<string.h>
using namespace std;

int main()
{
    ifstream f1("text.in");
    int long i=0,s=1,ok=0;
    char ch;
    while(!f1.eof())
    {
        f1.get(ch);
        while(((ch < 'a' ) && (ch > 'z' )) || ((ch < 'A' ) && (ch > 'Z')))
        f1.get(ch);
        if( ((ch >= 'a' ) && (ch <= 'z' )) || ((ch >= 'A' ) && (ch <= 'Z')))
        i++;
        if(ch==' ')
            s++;


    }
    f1.open("text.in");
    ofstream f2("text.out");
    f2<<i/s;


}