Advertisement
Guest User

Untitled

a guest
Mar 30th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. // ConsoleApplication1.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <fstream>
  7. #include <string>
  8.  
  9. using namespace std;
  10.  
  11.  
  12.  
  13.  
  14. int _tmain(int argc, _TCHAR* argv[])
  15. {
  16. ifstream plik("dane.txt");
  17. ofstream plikout("wynik.txt");
  18. int licznik=0;
  19.  
  20. if (plik){
  21.  
  22.  
  23.  
  24.  
  25. while (!plik.eof()){
  26. //czakaorn
  27. string dupa;
  28. int rozmiar;
  29. plik>>dupa;
  30. rozmiar=dupa.length()-1;
  31. if (dupa[0]==dupa[rozmiar]){
  32. licznik++; //szmato
  33. }
  34. //czaokrona
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44. }
  45. cout<<licznik;
  46.  
  47. }
  48.  
  49. system("pause");
  50.  
  51. plikout.close();
  52. return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement