Cod sursa(job #2609199)
| Utilizator | Data | 2 mai 2020 12:20:03 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp-64 | Status | done |
| Runda | igorj_mentorat1 | Marime | 0.64 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
string s, letters = "QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm";
int medie,cate,i,poz;
int main()
{
getline(f, s);
while(1)
{
poz = s.find_first_of(letters);
if(poz != string::npos)
{
s = s.substr(poz);
i = 0;
while(letters.find_first_of(s[i]) != string::npos && i < s.size())
++ i;
medie += i;
++ cate;
s = s.substr(i);
}
else
break;
}
g << medie / cate;
}
