Cod sursa(job #2274140)
Utilizator | Data | 1 noiembrie 2018 14:18:48 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<fstream>
using namespace std;
int numar, cuvinte;
ifstream in ("text.in");
ofstream out ("text.out");
char c;
int main(){
while(in.get(c)) {
if(isalpha(c)) {
cuvinte++;
while (isalpha(c)) {
numar++;
in.get(c);
}
}
}
out << numar / cuvinte << '\n';
in.close();
out.close();
return 0;
}