Cod sursa(job #139723)

Utilizator yonutzTalos Ionut yonutz Data 20 februarie 2008 15:50:33
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.64 kb
#include <fstream>
#include <conio.h>
using namespace std;
int main()
{ 
     ifstream f("text.in");
     char x;
     int cuvant,nr_cuv=0,lung_cuv=0;
     f>>x;cuvant=0;
   
   
     while (!f.eof())
     {
           if ((x>=65&&x<=90)||(x>=97&&x<=122))
           {if (cuvant==0) {cuvant=1;nr_cuv++;}
              lung_cuv++;
              }
              else
               cuvant=0;
              
              f>>x;
              }
           
     f.close();
     ofstream g("text.out");
     g<<lung_cuv<<" "<<nr_cuv;
     g.close();
     return 0;
     while (!kbhit());
     }