Hola amigos!! como andan?¿ (espero que muy bien!)
bueno tengo un "problemota" al compilar mi codigo, cuando lo compilo me muestra error en linea 3 (donde aparece el using namespace std;) ademas me sale otro error en la linea 5 (acerca de un parentesis) de verdad que no sé como solucionar esos erroresss!! !!! por favorrr ayudenmee de verdad y que dios se lo pague.... desde ya muchisimas gracias!!
(ESPERO QUE NO SEA ALGO MUY DIFICIL DE CORREGIR, YA QUE SOY UN NOVATO EN ESTO =(... )
LO COMPILE CON UBUNTU
#include <iostream>
#include <string.h>
using namespace std;
void Espacios(string &s){
int pos;
string s1=" ";
do{
pos=chrstr(s," ");
s1=substr(s,0,pos);
s=delstr(s,0,pos);
if(chrstr(s," ")==0){
s=delstr(s,0,1);
}
}while(s!=" ");
s=s1;
do{
pos=chrstr(s,".");
if(chrstr(s," ")<pos){
s1=substr(s,0,pos);
s=delstr(s,0,1);
}
}while(s!=" ");
s=s1;
do{
pos=chrstr(s,";");
if(chrstr(s," ")<pos){
s1=substr(s,0,pos);
s=delstr(s,0,1);
}
}while(s!=" ");
s=s1;
do{
pos=chrstr(s,":");
if(chrstr(s," ")<pos){
s1=substr(s,0,pos);
s=delstr(s,0,1);
}
}while(s!=" ");
s=s1;
do{
pos=chrstr(s,"(");
if(chrstr(s," ")>pos){
s=delstr(s,pos,pos+1);
}
pos=chrstr(s,")");
if(chrstr(s," ")<pos){
s=delstr(s,pos-1,pos);
}
s1=substr(s,0,pos);
s=delstr(s,0,pos);
}while(s!=" ");
s=s1;
do{
pos=chrstr(s,"¡");
if(chrstr(s," ")>pos){
s=delstr(s,pos,pos+1);
}
pos=chrstr(s,"!");
if(chrstr(s," ")<pos){
s=delstr(s,pos-1,pos);
}
s1=substr(s,0,pos);
s=delstr(s,0,pos);
}while(s!=" ");
s=s1;
do{
pos=chrstr(s,"¿");
if(chrstr(s," ")>pos){
s=delstr(s,pos,pos+1);
}
pos=chrstr(s,"?");
if(chrstr(s," ")<pos){
s=delstr(s,pos-1,pos);
}
s1=substr(s,0,pos);
s=delstr(s,0,pos);
}while(s!=" ");
s=s1;
}
void VerificarPunto(string &s){
int pos;
string s1=" ";
do{
pos=chrstr(s,".");
if(pos=0){
s=insstr(s,1,>>>>>);
s=intstr(s,0,<<<<<);
}else{
if(substr(s,pos,pos+2)=="..."){
s1=substr(s,0,pos+2);
s=delstr(s,0,pos+2);
}else{
s1=substr(s,0,pos);
s=delstr(s,0,pos);
}
}
}while(s!=" ");
s=s1;
};
void VerificarDosP(string &s){
int pos;
string s1=" ";
do{
pos=chrstr(s,":");
if(pos=0){
s=insstr(s,1,>>>>>);
s=intstr(s,0,<<<<<);
}else{
s1=substr(s,0,pos);
s=delstr(s,0,pos);
}
}while(s!=" ");
s=s1;
do{
pos=chrstr(s,";");
if(pos=0){
s=insstr(s,1,>>>>>);
s=intstr(s,0,<<<<<);
}else{
s1=substr(s,0,pos);
s=delstr(s,0,pos);
}
}while(s!=" ");
s=s1;
};
void VerificarSignos(string &s){
int pos1,pos2,n,m;
string s1=s2=s3=" ";
n=buscar(s,"?");
m=buscar(s;"¿");
if(n==0 || m==0){
do{
s1=substr(s,0,1);
if(s1=="?" || s1=="¿"){
s1=="<<<<<"+s1+">>>>>";
}
s2=s2+s1;
}
s=s2;
}else{
if( pos1=chrstr(s,"¿")>pos2=chrstr(s,"?")){
s=insstr(pos1+1,>>>>>);
s=insstr(pos1-1,<<<<<);
s=insstr(pos2+1,>>>>>);
s=insstr(pos2+1,<<<<<);
}else{
do{
pos1=chrstr(s,"¿");
pos2=chrstr(s,"?");
s1=substr(s,pos1+1,pos2+1);
do{
s2=substr(s1,0,1);
struct
s2==".":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="...":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="(":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2==")":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="!":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="¡":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="?":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="¿":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
}
s3=s3+s2;
}while(s!=" ");
s=s3;
}
}
n=buscar(s,"¡");
m=buscar(s;"!");
if(n==0 || m==0){
do{
s1=substr(s,0,1);
if(s1=="!" || s1=="¡"){
s1=="<<<<<"+s1+">>>>>";
}
s2=s2+s1;
}
s=s2;
}else{
if( pos1=chrstr(s,"¡")>pos2=chrstr(s,"!")){
s=insstr(pos1+1,>>>>>);
s=insstr(pos1-1,<<<<<);
s=insstr(pos2+1,>>>>>);
s=insstr(pos2+1,<<<<<);
}else{
do{
pos1=chrstr(s,"¡");
pos2=chrstr(s,"!");
s1=substr(s,pos1+1,pos2+1);
do{
s2=substr(s1,0,1);
struct
s2==".":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="...":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="(":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2==")":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="!":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="¡":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="?":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="¿":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
}
s3=s3+s2;
}while(s!=" ");
s=s3;
}
}
};
void VerificarParentesis(string &s){
int pos1,pos2,n,m;
string s1=s2=s3=" ";
n=buscar(s,")");
m=buscar(s;"(");
if(n==0 || m==0){
do{
s1=substr(s,0,1);
if(s1==")" || s1=="("){
s1=="<<<<<"+s1+">>>>>";
}
s2=s2+s1;
}
s=s2;
}else{
if( pos1=chrstr(s,"(")>pos2=chrstr(s,")")){
s=insstr(pos1+1,>>>>>);
s=insstr(pos1-1,<<<<<);
s=insstr(pos2+1,>>>>>);
s=insstr(pos2+1,<<<<<);
}else{
do{
pos1=chrstr(s,"(");
pos2=chrstr(s,")");
s1=substr(s,pos1+1,pos2+1);
do{
s2=substr(s1,0,1);
struct
s2==".":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="...":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="(":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2==")":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="!":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="¡":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="?":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
s2=="¿":: s2=insstr(s,1,>>>>>);
s2=intstr(s,0,<<<<<);
}
s3=s3+s2;
}while(s!=" ");
s=s3;
}
}
}
int buscar(string s; char k){
char s1;
int enc=1,i,n;
n=lenght(s);
for(i=1;i<n;i++){
s1=substr(s,i,i+1);
if(s1==n){
return(enc);
}
}
return(enc-1);
}
int main(){
string s;
cin>>s;
Espacio(s);
VerificarPunto(s);
VerificarParentesis(s);
VerificarDosP(s);
VerificarSignos(s);
cout<<s<<endl;
}