Facebook
From Violet Terrapin, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 221
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. int main(){
  6.         char znak, slowo[60];
  7.         int i=0,j;
  8.         ifstream wej("dane.txt");
  9.         ofstream wyj("wynik.txt");
  10.         while (!wej.eof()){
  11.                 wej>>slowo;
  12.                 j=0;
  13.                 while(slowo[j]!='\0'){
  14.                         j++;
  15.                         i++;
  16.                 }
  17.         }
  18.         wyj<<i;
  19.         wej.close();
  20.         wyj.close();
  21.         return 0;
  22. }