Cod sursa(job #1503793)
Utilizator | Data | 16 octombrie 2015 22:51:07 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<fstream>
using namespace std;
int x,alp,word;
char c;
int main(){
ifstream in("text.in");
while(in.get(c)){
if (isalpha(c))
{
alp=1;
x++;
}
else{
if (alp==1)
{
alp=0;
word++;
}
}
}
if (alp==1)
word++;
ofstream out("text.out");
out<<x/word;
in.close();
out.close();
return 0;
}