Cod sursa(job #1100036)

Utilizator armandpredaPreda Armand armandpreda Data 6 februarie 2014 15:50:37
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <cstdio>
#include <cstring>

using namespace std;

char s[205];
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    int n,nr=0,i,sm=0;
    gets(s);
    n=strlen(s);
    s[n]=' ';
    n++;
    s[n]=NULL;
    for(i=0;i<n;++i)
        {
        if(s[i]<65&&s[i-1]>=65)
                nr++;
        if(s[i]>=65)
            sm++;
        }
    sm=sm/nr;
    printf("%d",sm);
    return 0;
}