Cod sursa(job #1316576)
Utilizator | Data | 13 ianuarie 2015 22:03:50 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char x;
int c = 0;
int c1 = 0;
int cuv = 0;
while(f.get(x)){
if(isalpha(x)){
c++;
}
else
if(c > 0){
++cuv;
c1 += c;
c = 0;
}
}
g<<c1 / cuv;
return 0;
}