Cod sursa(job #1098185)

Utilizator zSh3kDarius zSh3k Data 4 februarie 2014 16:50:09
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.53 kb
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
    char s[100],b[200]="qwertyuioplkjhgfdsazxcvbnmQWERTYUIOPLKJHGFDSAZXCVBNM";
    int ct=0,cu=0;
    f.get(s,100);
    for(int i=0;i<strlen(s);i++)
        {
            if(strchr(b,s[i]))
                ct++;
            if(!strchr(b,s[i+1])  && strchr(b,s[i]))
                cu++;
        }
    g<<ct<<" "<<cu<<"\n";
    g<<ct/cu;
    f.close();
    g.close();
    return 0;
}