Normas del foro

Curso Hacker
Bienvenido(a), Visitante. Favor de ingresar o registrarse.
¿Perdiste tu email de activación? - Noviembre 18, 2008, 04:29:50
Inicio Ayuda Ingresar Registrarse
Visita: Articulos - Juegos Gratis - Da Foros

Comunidad Underground Hispana  |  Programacion  |  Programación  |  Carbide C/C#/C++  |  Tema: necesito ayuda con un programa en C de PILAS 0 Usuarios y 1 Visitante están viendo este tema. « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: necesito ayuda con un programa en C de PILAS  (Leído 357 veces)
luishrg
Recien Llegado
*
Desconectado Desconectado

Mensajes: 19


Ver Perfil Email
« en: Octubre 17, 2005, 04:01:02 »

Necesito q porfavor me ayuden con el siguiente programa es para un examen pero no me sale bien me salen 6 errores y no los puedo corregir

ahi les va el codigo::


#include<string.h>
#include<stdio.h>
void polaca(char [], char );

int main(){
char Q[100], P[100];
clrscr();
printf("Introduce Q: "); scanf("%s", Q);
printf("Funcion : %s\n", Q);
polaca(Q, &P);
printf("Su notacion polaca es: %s", P);
getch();
return 0;
}

void polaca(char Q[100], char *P){

char PILA[1000];
int pPila= 0, pP=0, i=0,j=0;
strcpy(P,"");
PILA[pPila++]= '(';
strcat(Q,")");
for (i=0; i < strlen(Q); i++){
if ((Q>='A' && Q<='Z') || (Q>='a' && Q<='z'))
P[pP++]=Q;
else if (Q=='(')
PILA[pPila++]=Q;
else if (Q=='+' || Q=='-' || Q=='*' || Q=='/' || Q=='^'){
for(j=pPila-1; j>=0 && PILA[j] !='('; j--){
if (Q=='+' || Q=='-' && PILA[j] != '('){
P[pP++]=PILA[j];
pPila--;
{
if ((Q=='*' || Q=='/') && (PILA[j]=='/' || PILA[j]=='*' || PILA[j]=='^') && PILA[j] != '('){
P[pP++]=PILA[j];
pPila--;
}
if ((Q=='^') && (PILA[j]=='^') && PILA[j] != '(') {
P[pP++]=PILA[j];
pPila--;
}
PILA[pPila++]=Q;
}
else if (Q== ')'){
j=pPila-1;
while (PILA[j] != '(')
{
if (PILA[j]=='+' || PILA[j]=='-' || PILA[j]=='*' || PILA[j]=='/' || PILA[j]=='^'){
P[pP++]= PILA[j];
pPila=j;
}
j--;
}
pPila--;
}
}
P[pP]=0;
}
En línea
codelogman
Visitante
« Respuesta #1 en: Octubre 17, 2005, 04:11:46 »

puedes poner el texto de los errores sirve que te digo como interpretarlos
En línea
luishrg
Recien Llegado
*
Desconectado Desconectado

Mensajes: 19


Ver Perfil Email
« Respuesta #2 en: Octubre 17, 2005, 04:41:52 »

aqui esta lo q dicen los errores



linea 10:: Type mismatch in parameter 2 in call to 'polaca' in function main

linea 16:: Type mismatch in redeclaration of 'polaca'

linea 44:: Misplaced else in function polaca

linea 58:: Compound statement missing } in function polaca

linea 59:: Compound statement missing } in function polaca


linea 60::Compound statement missing } in function polaca
En línea
luishrg
Recien Llegado
*
Desconectado Desconectado

Mensajes: 19


Ver Perfil Email
« Respuesta #3 en: Octubre 17, 2005, 04:42:32 »

En línea
Dark-MX
Miembro
*****
Desconectado Desconectado

Mensajes: 57


Ver Perfil Email
« Respuesta #4 en: Octubre 17, 2005, 07:08:55 »

el peor enemigo del foro es la fuente italica o cursiva...

std::vector a(10);
for (int i = 0; i < 10; ++i) {
    a = 10;
}


ke notan?

[ i ]  = inicia cursiva -__-   =(
En línea
Páginas: [1] Ir Arriba Imprimir 
Comunidad Underground Hispana  |  Programacion  |  Programación  |  Carbide C/C#/C++  |  Tema: necesito ayuda con un programa en C de PILAS « anterior próximo »
Ir a:  


Ranking-Hits
Powered by SMF 1.1.7 | SMF © 2006-2007, Simple Machines LLC