Cod sursa(job #1497980)
Utilizator | Data | 7 octombrie 2015 21:02:08 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include<fstream>
#include<string.h>
using namespace std;
int main(){
char s[100];
int k=0,k1=0;
ifstream fi("text.in");
ofstream fo("text.out");
fi.get(s,80);
for(int i=1;i<=strlen(s);i++){
if(((s[i]>='A')&&(s[i]<='Z'))||((s[i]>='a')&&(s[i]<='z'))) k++;
if(s[i]==' ') k1++;
}
k1++;
fo<<k/k1;
fi.close();
fo.close();
return 0;
}