Cod sursa(job #211241)
| Utilizator | Data | 1 octombrie 2008 16:12:58 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <iostream>
using namespace std;
char c;
int nr,i;
bool k;
void scan()
{
freopen("text.in","r",stdin);
scanf("%c",&c);
nr=0;
i=0;
k=true;
while (k==true)
{
if (c==' ') i++;
if (((c>='A') & (c<='Z')) | ((c>='a') & (c<='z'))) nr++;
if (c<' ') k=false;
scanf("%c", &c);
}
i++;
}
void writeit()
{
freopen("text.out","w",stdout);
printf("%d", nr/i);
}
int main()
{
scan();
writeit();
return 0;
}
