Cod sursa(job #806944)
| Utilizator | Data | 3 noiembrie 2012 19:20:07 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
char a[5000],b;
int i,x=0,y=0;
fin.get(a,5000);
b=' ';
if(((65<=a[1])&&(a[1]<=90))||((97<=a[1])&&(a[1]<=122))) y=1;
for(i=0;i<strlen(a);i++)
{
if(((65<=a[i])&&(a[i]<=90))||((97<=a[i])&&(a[i]<=122)))x++;
else
{
if((65<=b)&&(b<=90)) y++; if((97<=b)&&(b<=122)) y++;
}
b=a[i];
}
fout<<x/y;
}
