Cod sursa(job #626591)
| Utilizator | Data | 27 octombrie 2011 18:53:08 | |
|---|---|---|---|
| Problema | Text | Scor | 70 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.41 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)
{cout<<x<<" ";
if((x>='a' && x<='z') || (x>='A' && x<='Z')){gasit=0; litere++;} else {gasit++; cout<<x<<"<-"<<nr<<endl;}
if (gasit==1)nr++;
x=fgetc(R);
}litere--;
g<<litere/nr;
return 0;
}
