Cod sursa(job #2021191)

Utilizator ruxandra_lutanRuxandra Lutan ruxandra_lutan Data 12 septembrie 2017 20:40:19
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.42 kb
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
long long nr1=0,nr2=0,ok=0;
char c,litere[]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPRSTUVWXYZ";
int main()
{
    while(f.get(c))
      if(strchr(litere,c)!=0)
      {
        ok=1;
        nr1++;
      }
      else
      {
          if(ok==1) nr2++;
          ok=0;
      }
  g<<nr1/nr2;

  return 0;}