Cod sursa(job #493722)
Utilizator | Data | 19 octombrie 2010 09:30:32 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include<iostream.h>
#include<fstream.h>
#include<string.h>
#include<ctype.h>
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char s[256];
long long i,j=0,k=0;
while(f.get(s,255))
for(i=0;i<=strlen(s)-1;i++)
if(isalnum(s[i])){j++;
if(!isalpha(s[i-1])) k++;}
g<<j/k;
cout<<j<<endl<<k;
g.close();
f.close();
}