Cod sursa(job #2310861)
Utilizator | Data | 2 ianuarie 2019 11:46:52 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main(){
char s;
int counter1=0,counter2=0;
while(fin>> noskipws >>s){
if(isalpha(s)){
counter1++;
while(isalpha(s)){
counter2++;
fin>>noskipws>>s;
}
}
}
fout<<counter2/counter1;
fin.close();
fout.close();
return 0;
}