Cod sursa(job #626608)
| Utilizator | Data | 27 octombrie 2011 19:25:31 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.37 kb |
#include<fstream>
#include<iostream>
#include <stdio.h>
using namespace std;
int main()
{ FILE * R;
int nr=0,gasit,litere=0; char x;
R=fopen ("text.in","r");
ofstream g("text.out");
x=fgetc(R);
while(x!=EOF)
{
if((x>='a' && x<='z') || (x>='A' && x<='Z')){gasit=0; litere++; } else gasit++;
if (gasit==1 && litere!=0)nr++;
x=fgetc(R);
}
g<<litere/nr;
return 0;
}
