Cod sursa(job #395788)
Utilizator | mihai995 mihai995 | Data | 13 februarie 2010 19:46:05 |
---|---|---|---|
Problema | Text | Scor | 60 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.51 kb |
#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++;
count/=nr;
o<<count;
return 0;
}