Pagini recente » Diferente pentru utilizator/dornescuvlad intre reviziile 102 si 61 | Cod sursa (job #412086) | Cod sursa (job #1035840) | Cod sursa (job #1247579) | Cod sursa (job #395791)
Cod sursa(job #395791)
#include <fstream>
using namespace std;
char s[]="1234567890qwertyuioplkjhgfdsazxcvbnmMNBVCXZASDFGHJKLPOIUYTREWQ";
int v(char c)
{
for (int i=0;i<62;i++)
if (s[i]==c) return 1;
return 0;
}
int main()
{
unsigned long long count=0,nr=0,cuv=0;
bool a=0;
char c;
ifstream f("text.in");
ofstream o("text.out");
f>>noskipws>>c;
if (v(c)) {a=1;cuv++;}
while (f>>noskipws>>c)
{
if (v(c)) count++;
if (a && !v(c)) nr++;
a=v(c);
}
if (a) nr++;
if (nr!=0) {count/=nr;
o<<count;}
else o<<"0";
return 0;
}