Cod sursa(job #597636)
Utilizator | FMI Ekart Dragos-Ioan fulgerulnegru | Data | 22 iunie 2011 18:13:47 |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include<fstream>
#include<iostream>
using namespace std;
ifstream in ("text.in");
ofstream out ("text.out");
int main (){
char c;
int t=0;
in>>c;
int suma=0,nr=0;
while(!in.eof()){
in>>c;
out<<c;
if((c>='a'&&c<='z')||(c>='A'&&c<='Z')&&c!=' '){
suma++;
t=1;
}
else
if(t==1){
nr++;
}
}
cout<<suma<<" "<<nr;
suma=suma/nr;
out<<suma;
in.close();
out.close();
return 0;
}