Cod sursa(job #1429554)
| Utilizator | Data | 6 mai 2015 17:28:50 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.69 kb |
#include <iostream>
#include <fstream>
#include <cctype>
#include <string.h>
using namespace std;
//#define FOR(i,a,b) for(i=a;b<=b;i++)
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char sir[1000000];
f.get(sir,100000001);
int ok=0;
int lung = strlen(sir);
int contor1=0;
int contor2=0;
for(int i = 0 ; i <=lung+1 ;i ++ )
{
if(isalpha(sir[i]))
{contor1++;
ok=1;
}
else
{
if(ok == 1)
contor2++;
ok=0;
}
}
if(contor2 == 0 )
g<<0;
else
g<<contor1/contor2;
}
