Pagini recente » Cod sursa (job #1150465) | Cod sursa (job #1181547) | Cod sursa (job #1271627) | Cod sursa (job #1469833) | Cod sursa (job #1469819)
#include <iostream>
#include <fstream>
#include <algorithm>
#include <math.h>
#include <string>
#include <vector>
#include <stdio.h>
#define LL long long
using namespace std;
string s;
ofstream f;
ifstream g;
int main()
{
f.open("text.out");
g.open("text.in");
getline(g,s);
int cnt=0,w=0;
bool ok=false;
for (int i=0; i<s.size(); i++)
{
if ((s[i]-'0'>16 && s[i]-'0'<43) || (s[i]-'0'>48 && s[i]-'0'<75))
{
cnt++;
ok=true;
}
else if (ok)
{
w++;
ok=false;
}
}
if(ok)
w++;
f<<cnt/w;
return 0;
}