Cod sursa(job #2576267)
| Utilizator | Data | 6 martie 2020 18:11:46 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 kb |
#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int k,p,j;
char s[256],lit[]="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
int main()
{
f.get(s,256);
for(int i=0;i<strlen(s);i++)
{
if(strchr(lit,s[i]))
{
while(strchr(lit,s[i])) i++;
p++;
}
}
for(int i=0;i<strlen(s);i++)
{
if(strchr(lit,s[i]))
{
k++;
}
}
g<<k/p;
return 0;
}
