Cod sursa(job #1095929)

Utilizator StranycAlexandru K. Stranyc Data 1 februarie 2014 11:19:47
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.93 kb
#include <iostream>
#include <fstream>
#include <string>
#include <string.h>
using namespace std;
ifstream fi("text.in");
ofstream fo("text.out");
int main()
{   int sum=0,k=0;
    string s;
/*    while(!fi.eof()){*/
                     getline(fi,s); cout<<s;
                     int i=0;
                     while(i<s.length()){
                                         if(isalpha(s[i]) && i<s.length()){
                                                           sum++;
                                                           while(i<s.length() && isalpha(s[i])) {sum++; i++;}
                                                           i++;
                                                           k++;
                                                           }
                                         i++;
                                         }
  /*                   }*/
    fo<<(sum-2)/k;
    cin>>s;
}