Cod sursa(job #806917)
| Utilizator | Data | 3 noiembrie 2012 18:43:09 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.55 kb |
#include <iostream.h>
#include <fstream.h>
#include <string.h>
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
char a[1000];
int i,x=0,y=0;
fin.get(a,1000);
for(i=0;i<strlen(a);i++)
{
if((65<=a[i])&&(a[i]<=90))
{x++;}
else {
if((97<=a[i])&&(a[i]<=122))
{x++;}
else
{ while((a[i+1]<65)||(a[i+1]>122)||((a[i+1]>90)&&(a[i+1]<97)))
i++;
y++;
}
}
}
fout<<x/y;
}
