Cod sursa(job #818843)

Utilizator ionutzm05Marisca Mihai Ionut ionutzm05 Data 18 noiembrie 2012 09:27:46
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <string.h>
#include <fstream>
#include <cmath>
using namespace std;

int main()
{
    char s[1000];
    int i,c=1,d=0;
    ifstream f("text.in");
    ofstream g("text.out");
    f.get(s,100);
    for(i=0;i<strlen(s);i++)
        if(s[i]==' ')
          c++;
        else
          if(strchr("abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",s[i])!=NULL)
            d++;
    g<<floor(d/c);
    return 0;
}