Cod sursa(job #2533914)

Utilizator GaByxDTodor Marian Gabriel GaByxD Data 29 ianuarie 2020 20:39:58
Problema Text Scor 10
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.55 kb
#include<fstream>
#include<string.h>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
int k,kc,i;
char s[1000];
int main()
{
    f.get(s,1000);
    for(i=0;i<strlen(s);i++)
        if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
            k++;
    i=0;
    while(i<strlen(s))
        {while((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
            i++;
        i++;
        if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
            kc++;}

    if(kc!=0)
        g<<k/kc-1;
    else
        g<<1;


}