Cod sursa(job #1486599)
Utilizator | Data | 15 septembrie 2015 10:45:22 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <fstream>
#include <cctype>
using namespace std;
int lg,nr;
char c;
bool ok;
int main()
{
ifstream f ("text.in");
ofstream g ("text.out");
while(f.get(c))
{
if(isalnum(c))
{
lg++;
if(!ok)
{
ok=true;
nr++;
}
}
else
ok=false;
}
g<<lg/nr;
return 0;
}