Cod sursa(job #561338)
| Utilizator | Data | 19 martie 2011 20:39:56 | |
|---|---|---|---|
| Problema | Text | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<iostream.h>
#include<fstream.h>
#include<cctype>
int main()
{int i=1,s=1,n=0,p=0,l=0;
char a[1000];
ifstream f("text.in",ios::in);
ofstream g("text.out",ios::out);
while(f.get(a[i]))
i++;
for(s=1;s<=i;s++)
if(((a[s]>='a')&&(a[s]<='z'))||((a[s]>='A')&&(a[s]<='Z')))
l++;
for(s=1;s<=i;s++)
if(a[s]==' ')
p++;
s=l/p;
g<<s;
f.close();
g.close();
}