Cod sursa(job #2148085)
| Utilizator | Data | 1 martie 2018 15:23:57 | |
|---|---|---|---|
| Problema | Text | Scor | 50 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
char alfabet[] = "abcdefghijklmnopqrstuvwxqzABCDEFGHIJKLMNOPQRSTUVQXYZ";
int main()
{
char cuv[1000],*p;
int n = 0;
int lng = 0;
while(in>>cuv)
{
n++;
for(int i=0;i<strlen(cuv);++i)
{
if(strchr(alfabet,cuv[i]))
{
lng++;
}
}
}
out<< 1LL * lng/n;
}
