Mai intai trebuie sa te autentifici.
Cod sursa(job #951877)
Utilizator | Data | 22 mai 2013 07:44:38 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <fstream>
#include <iostream>
#include <string>
#include <string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int lungime, nr;
int main(){
char chr;
int trecut = 0, ascii;
while (fin.get(chr)) {
ascii=chr;
if ((ascii>=97 && ascii<=122) || (ascii>=65 && ascii<=90)) {
lungime++;
trecut = 1;
}else {
if (trecut)
nr++;
trecut = 0;
}
}
fout<<lungime/nr;
return 0;
}