Cod sursa(job #525678)
Utilizator | Data | 25 ianuarie 2011 20:42:48 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include<iostream>
#include<fstream>
using namespace std;
int lungime,numar;
int ischar(char x){
if(x>=65 and x<=90 ) return 1;
if(x>=97 and x<=122) return 1;
return 0;
}
void proces(){
ifstream in("text.in");
char c[20];
while(in>>c){
lungime++;
for(int i=0;i<strlen(c);i++)
if(ischar(c[i]))numar++;
}
in.close();
}
int main(){
proces();
ofstream out("text.out");
out<<numar/lungime;
out.close();
return 0;
}