Cod sursa(job #1363401)

Utilizator george.buneaFMI George Bunea george.bunea Data 26 februarie 2015 22:30:01
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.37 kb
#include <fstream>
#include <string.h>

using namespace std;

int main()
{
    ifstream f("text.in");
    ofstream g("text.out");

    char s[1024],*p;
    int sum=0,nr=0,i=0,al=0;
    f.get(s,1023);
    while(s[i]){
        if(s[i]==' ')
            nr++;
        if(isalpha(s[i]))
         al++;
        i++;
    }

    g<<al/(nr+1);


    return 0;
}