Cod sursa(job #1022211)
Utilizator | Data | 4 noiembrie 2013 22:14:14 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
using namespace std;
char a;
int main()
{
float s=0,k=0,ok=1;
fstream fin("text.in",ios::in);
fstream fout("text.out",ios::out);
while (fin.get(a))
{
if(isalpha(a))
{
s++;
if(ok)
k++,ok=0;
}
else
ok=1;
}
if (k!=0)
fout << s/k;
}