Cod sursa(job #474333)
Utilizator | UPB-Oprea-Cosmin-Dumitru batista | Data | 3 august 2010 13:57:57 |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<fstream>
#include<string>
using namespace std;
int main()
{char a[300000],b[300000],*p,s[]="0123456789~`!@#$%^&*()-_\+=*/':;?/>.<, " ;long long k=0,x,y;
ifstream f("text.in");ofstream g("text.out");
f.getline(a,100);
p=strtok(a,s);
while(p)
{
k++;
strcat(b,p);
p=strtok(NULL,s);
}
x=strlen(b);
y=x/k;
g<<y;
f.close();g.close();
return 0;}