Cod sursa(job #997834)
Utilizator | Data | 14 septembrie 2013 22:08:12 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <iostream>
#include<string.h>
#include<fstream>
#include <ctype.h>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
int main()
{
int p,r,a;
char c;
p=0;
r=0;
a=0;
while(!f.eof())
{
f.get(c);
if(isalpha(c)!=0)
{
++p;
a=1;
}
else if (a==1)
{
++r;
a=0;
}
}
g<<p/r;
}