Cod sursa(job #534011)
| Utilizator | Data | 14 februarie 2011 22:46:52 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.47 kb |
#include<fstream>
#include<ctype.h>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
int nrc=0,nrl=0;
char c=' ';
while(!isalpha(c)&&!f.eof()) f.get(c);
while(!f.eof())
{
while(isalpha(c)){
if(isalpha(c)) nrl++;
f.get(c);
g<<c;
if(f.eof()) break;
}
while(!isalpha(c)&&!f.eof()) f.get(c);
nrc++;
if(f.eof()) {break;}
}
g<<nrl<<" "<<nrc<<" "<<nrl/nrc;
return 0;
}