Cod sursa(job #1613331)
Utilizator | Data | 25 februarie 2016 12:23:13 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<fstream>
using namespace std;
int a, b, p, k;
char c;
int main(){
ifstream fin("text.in");
ofstream fout("text.out");
while(fin.get(c))
{
//if(c==' ')
// p++;
if((c>='a' && c<='z') || (c>='A' && c<='Z')){
a++;
k=1;
}
else{
if(k>0)
k=-1;
}
if(k==-1){
p++;
k=0;
}
}
fout<<a/p;
return 0;
}