Cod sursa(job #1561885)
Utilizator | Data | 4 ianuarie 2016 17:28:10 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <iostream>
#include <cstring>
#include <cctype>
#include <fstream>
using namespace std;
int main()
{ char s[10000], *p, *k ;
int nr=0, sh=1;
ifstream f("text.in");
ofstream g("text.out");
f.get(s,10000);
for (p=s;*p;p++) {if(isalpha(*p)) nr++;
if(*p==' '&&*(p+1)!=' ') sh++;}
g<<nr/sh;
return 0;
}