Cod sursa(job #493334)
Utilizator | Data | 17 octombrie 2010 19:46:42 | |
---|---|---|---|
Problema | Text | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include<iostream.h>
#include<fstream.h>
#include<string.h>
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char s[256],d[20]=" ,.?<>:;!",e[2]=" ";
int i,j=0,k=0;
f.get(s,255);
for(i=0;i<=strlen(s)-1;i++)
if(strchr(e,s[i])) k++;
for(i=0;i<=strlen(s)-1;i++)
if(!strchr(d,s[i]))j++;
g<<j/k;
}