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
Software Engineer for AI Training Data (School Specific)
@ G2i Inc | Remote
Software Engineer for AI Training Data (Python)
@ G2i Inc | Remote
Software Engineer for AI Training Data (Tier 2)
@ G2i Inc | Remote
Data Engineer
@ Lemon.io | Remote: Europe, LATAM, Canada, UK, Asia, Oceania
Artificial Intelligence – Bioinformatic Expert
@ University of Texas Medical Branch | Galveston, TX
Lead Developer (AI)
@ Cere Network | San Francisco, US