Advertisement
Razk2108

Imprimir palabras invertidas

Sep 28th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6.     int n=0,mayor,tam;
  7.     string nombre;
  8.     cout<<"Ingrese su nombre: ";
  9.     getline(cin,nombre);
  10.     tam=nombre.length();
  11.     for(int i=tam-1;i>=n;i--){
  12.         cout<<nombre[i];
  13.     }
  14.  
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement