Cod sursa(job #1514768)
Utilizator | Data | 31 octombrie 2015 16:15:38 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <fstream>
#include <cstring>
using namespace std;
int main()
{ifstream f("text.in");
ofstream g("text.out");
int x,s1=0,k=0;
char s[10000];
f.get(s,10000);
char *p=strtok(s," ");
while(p)
{
s1=s1+strlen(p);
p=strtok(0," ");
k++;
}
x=k/s1;
g<<x;
return 0;
}