Advertisement
seberm

seberm

Oct 15th, 2008
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.98 KB | None | 0 0
  1. /***************************************************************************
  2.  *   Copyright (C) 2008 by Šabart Otto                                     *
  3.  *   otik10@seznam.cz                                                      *
  4.  *                                                                         *
  5.  *   This program is free software; you can redistribute it and/or modify  *
  6.  *   it under the terms of the GNU General Public License as published by  *
  7.  *   the Free Software Foundation; either version 2 of the License, or     *
  8.  *   (at your option) any later version.                                   *
  9.  *                                                                         *
  10.  *   This program is distributed in the hope that it will be useful,       *
  11.  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
  12.  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
  13.  *   GNU General Public License for more details.                          *
  14.  *                                                                         *
  15.  *   You should have received a copy of the GNU General Public License     *
  16.  *   along with this program; if not, write to the                         *
  17.  *   Free Software Foundation, Inc.,                                       *
  18.  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  19.  ***************************************************************************/
  20.  
  21.  
  22. #ifdef HAVE_CONFIG_H
  23. #include <config.h>
  24. #endif
  25.  
  26. #include <iostream>
  27. #include <cstdlib>
  28.  
  29. using namespace std;
  30. //...Konstanty pro pole
  31. const int Arr = 50;
  32.   char end;
  33. int main(int argc, char *argv[])
  34. {
  35.   //...promenne
  36.   char veta[Arr];
  37.  
  38.   cout << "...Zobrazuje vetu v opacnem poradi pismenek...\n";
  39.  
  40.     cout << "Zadejte vetu:\n";
  41.  
  42.     cin.getline(veta, 50);
  43.  
  44.     //...cyklus...cte po zpatku
  45.     for(int i = strlen(veta) - 1;i <= strlen(veta); i--)
  46.       cout << veta[i] << "\n";
  47.  
  48.   return EXIT_SUCCESS;
  49. }
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement