Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Char inverter.cpp: Inverte le lettere di una parola
- /* * Copyright © 2017-2023 Lorenzo Fiocco <https://lorenzo.fioc.co>
- * This program is free software. It comes without any warranty, to
- * the extent permitted by applicable law. You can redistribute it
- * and/or modify it under the terms of the Do What The F*** You Want
- * To Public License, Version 2, as published by Sam Hocevar. See
- * http://www.wtfpl.net/ for more details. */
- #include <iostream>
- using namespace std;
- /* Variabili utilizzate
- INPUT
- parola (stringa): contiene la parola da invertire
- LAVORO
- i (intero): indica il carattere da leggere nella for
- */
- int main(){
- string parola;
- cout << "Inserisci parola: ";
- cin >> parola;
- for (unsigned int i=parola.size(); i>=0; i--)
- cout << parola[i];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement