Cod sursa(job #1477295)

Utilizator grimkidGafton Rares-Mihai grimkid Data 25 august 2015 20:36:29
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.57 kb
#include<cstdio>
using namespace std;
FILE *fin,*fout;
char text[1024];
int size,i,j;
int main(){
    fin = freopen("text.in","r",stdin);
    fout = freopen("text.out","w",stdout);
    i=scanf("%s",text);
    size = sizeof(text)-1;
    i=0;
    j=size-1;
    while(j>=0){
                
                if(!((text[j]>=48&&text[j]<=57)||(text[j]>=65&&text[j]<=90)||(text[j]>=97&&text[j]<=122))){
                   i++;
                }
    }
    if(i>0) printf("%d",(size-1)/i);
    else printf("0");
    fclose(fin);
    fclose(fout);
    return 0;   
}