Cod sursa(job #1670580)
Utilizator | Data | 31 martie 2016 20:59:23 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.6 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int lit,nrc,l,k,i;
char v[]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char x;
int main()
{
while(f.get(x)){
k=0;
while(strchr(v,x)){
if(k==0)++nrc;
++lit;
++i;
k=1;
f.get(x);
}
++i;
}
g<<lit/nrc;
return 0;
}