Cod sursa(job #1257027)
Utilizator | Data | 7 noiembrie 2014 09:39:00 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <iostream>
#include <fstream>
#include <cctype>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char a;
int x,y,z;
x=y=z=0;
while(f.get(a)!=0){
if(isalpha(a)){
++x;
y=1;
}
else{
if(y==1){
z++;
y=0;
}
}
}
g <<x/z;
return 0;
}