Cod sursa(job #2225586)
Utilizator | Data | 27 iulie 2018 17:12:48 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main(){
int cuvinte=1,caractere=0;
char x;
while((x = fin.get()) != EOF){
if(isalpha(x)){ caractere+=1;}
else if(x==' '){ cuvinte+=1;};
}
fout << caractere/cuvinte;
return 0;
}