all AI news
String, invertir una cadena
March 23, 2024, 2:59 p.m. | Leo
DEV Community dev.to
main
/*
AUTOR: Neftalí Leobardo Vázquez Castillo
CURSO: Estructura de Datos
PROGRAMA: Invertir una cadena
FECHA: 22 de Marzo del 2024
*/
#include <iostream>
#include "string.hpp"
int main() {
stack s(100);
std::string str;
getline (std::cin, str);
for (int i = 0; i < str.length(); i++) s.push(str[i]);
s.print();
return 0;
}
string.cpp
#include "string.hpp"
stack::node::node(char x) {
_data = x;
_next = nullptr;
}
stack::stack(int m){
n = m;
s = 0;
init = nullptr;
}
stack::~stack(){
while(init != nullptr) { …
More from dev.to / DEV Community
Jobs in AI, ML, Big Data
AI Research Scientist
@ Vara | Berlin, Germany and Remote
Data Architect
@ University of Texas at Austin | Austin, TX
Data ETL Engineer
@ University of Texas at Austin | Austin, TX
Lead GNSS Data Scientist
@ Lurra Systems | Melbourne
Senior Machine Learning Engineer (MLOps)
@ Promaton | Remote, Europe
Data Analyst (Digital Business Analyst)
@ Activate Interactive Pte Ltd | Singapore, Central Singapore, Singapore