Cod sursa(job #1571309)
Utilizator | Data | 17 ianuarie 2016 20:07:40 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <fstream>
#include <cstring>
using namespace std;
int lung=0, cuv=0, med, i;
char s[500];
ifstream fin("text.in");
ofstream fout("text.out");
int main(){
fin.get(s, 500);
for(i=0;i<=strlen(s);i++){
int x=0;
if(s[i]>='A' && s[i]<<'z')
while(s[i]>='A' && s[i]<<'z'){
x++;
i++;
}
if(x!=0){
lung+=x;
cuv++;
}
}
med=lung/cuv;
fout<<med;
return 0;
}