Cod sursa(job #2409974)
Utilizator | Data | 19 aprilie 2019 16:48:09 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include<bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char ch;
int main()
{char alfabet[]="abcdefghijklmnopqrstuvwxyzABCDEFIJKLMNOPQRSTUVWXYZ";
int cuv=0,car=0;
while(f>>noskipws>>ch)
{if(strchr(alfabet,ch))
{cuv++;
while(strchr(alfabet,ch))
car++,f>>ch;
}
}
g<<car/cuv;
f.close();
g.close();
return 0;
}