Cod sursa(job #1332928)
Utilizator | Deszi Marcus Mazzele | Data | 2 februarie 2015 16:24:14 |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <iostream>
#include <fstream>
#include <stdlib.h>
#include <ctype.h>
#include <cstring>
using namespace std;
int main()
{
char c;int nc=0,lt=0;
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{
f>>c;
if(isalpha(c))
{
lt++;
if(!isalpha(f.peek()))
nc++;
}
}
g<<lt/nc;
return 0;
}