• Miércoles 8 de Mayo de 2024, 18:49

Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Temas - gabrielaaA

Páginas: [1]
1
C/C++ / pasarlo a C++
« en: Jueves 13 de Mayo de 2010, 17:19 »
hola necesito q me ayuden a pasarlo a c++


program DELBLANK;
uses wincrt;
const
N=70;
type
A=string[N];
var
FRASE,FRASE1:A;
CB,I,J:integer;
begin
readln(FRASE);
FRASE1:=FRASE;
if (pos(' ',FRASE)<>0) then
begin
FRASE1:='';
repeat
I:=pos(' ',FRASE);
if (I>1) then
FRASE1:=FRASE1 + copy(FRASE,1,I);
CB:=0;
J:=I;
while (FRASE[J]=' ') do
begin
J:=J+1;
CB:=CB+1;
end;
delete(FRASE,1,J-1);
until (pos(' ',FRASE)=0);
end;
FRASE1:=FRASE1 + copy(FRASE,1,I);
writeln(FRASE1);
writeln(pos(' ',FRASE));
end.

2
Pascal / hola necesito q me ayuden a pasarlo a C++
« en: Miércoles 12 de Mayo de 2010, 20:54 »
hola necesito q me ayuden a pasarlo a c++


program DELBLANK;
uses wincrt;
const
 N=70;
type
 A=string[N];
var
 FRASE,FRASE1:A;
 CB,I,J:integer;
begin
 readln(FRASE);
 FRASE1:=FRASE;
 if (pos(' ',FRASE)<>0) then
 begin
  FRASE1:='';
  repeat
   I:=pos(' ',FRASE);
   if (I>1) then
    FRASE1:=FRASE1 + copy(FRASE,1,I);
   CB:=0;
   J:=I;
   while (FRASE[J]=' ') do
   begin
    J:=J+1;
    CB:=CB+1;
   end;
   delete(FRASE,1,J-1);
  until (pos(' ',FRASE)=0);
 end;
 FRASE1:=FRASE1 + copy(FRASE,1,I);
 writeln(FRASE1);
 writeln(pos(' ',FRASE));
end.

3
C/C++ / convertir este programa a c++
« en: Miércoles 5 de Mayo de 2010, 18:21 »
hola necesito convertir este programa a c++ graxias!!


Program MENU;
uses wincrt;
var
OPCIONP,OPCIONS:char;
NE,A,I,B,E,IT:integer;
NUMT,NUM,POT,D:longint;
P:real;
begin
repeat
clrscr;
writeln(' Menu Principal');
writeln('1. Calcular Factorial');
writeln('2. Calcular Potencia');
writeln('3. Conversiones');
writeln('4. Salir del Programa');
write('Seleccione su opcion:');
readln(OPCIONP);
case OPCIONP of
'1':Begin
A:=1;
writeln('Factorial de un numero');
write('Introduzca el numero que va a evaluar: ');
readln(NE);
for I:=1 to NE do
begin
A:=A*NE;
NE:=NE-1;
end;
writeln('El factorial es:',A);
writeln('presione una tecla para continuar');
readkey;
end;
'2':Begin
writeln('introduzca Base');
readln(b);
writeln('introduzca Exponente');
readln(e);
if (e>=0) then
begin
P:=1;
For IT:=1 to e do
begin
p:=p*b;
end;
end;
writeln('la potencia positiva es ',p:0:0);
readkey;
end;

'3':Begin
repeat
clrscr;
writeln(' Menu Conversiones');
writeln('1. binario-decimal');
writeln('2. binario-octal');
writeln('3. decimal-octal');
writeln('4. volver al menu principal');
write('Seleccione su opcion:');
readln(OPCIONS);
case OPCIONS of
'1':Begin
write('ingrese el numero binario:');
readln(NUM);
NUMT:=0;
POT:=1;
repeat
D:=NUM mod 10;
NUMT:=NUMT + D*POT;
NUM:=NUM div 10;
POT:=POT*2;
until NUM=0;
writeln('el equivalente decimal es:',NUMT);
writeln('presione una tecla para continuar');
readkey;
end;
'2':Begin
write('ingrese el numero binario:');
readln(NUM);
NUMT:=0;
POT:=1;
repeat
D:=NUM mod 8;
NUMT:=NUMT + D*POT;
NUM:=NUM div 8;
POT:=POT*2;
until NUM=0;
writeln('el equivalente octal es:',NUMT);
writeln('presione una tecla para continuar');
readkey;
end;
'3':Begin
Writeln('Estoy en la opcion 3');
writeln('presione una tecla para continuar');
readkey;
write('ingrese el numero decimal:');
readln(NUM);
NUMT:=0;
POT:=1;
repeat
D:=NUM mod 8;
NUMT:=NUMT + D*POT;
NUM:=NUM div 8;
POT:=POT*8
until NUM=0;
writeln('el equivalente octal es:',NUMT);
end;
'4':Begin
Writeln('Volviendo al menu principal');
writeln('presione una tecla para continuar');
readkey;
end;
else
Begin
Writeln('Error en la seleccion');
writeln('presione una tecla para continuar');
readkey;
end;
end;
until OPCIONS='4';
end;
'4':Begin
Writeln('Saliendo del programa');
writeln('presione una tecla para continuar');
readkey;
end;
else
Begin
Writeln('Error en la seleccion');
writeln('presione una tecla para continuar');
readkey;
end;
end;
until OPCIONP='4';
donewincrt;
end.

4
Pascal / no me corre!!
« en: Viernes 16 de Abril de 2010, 01:59 »
hola necesito que me ayuden con este programa cuando le doy en run dice rumtime error  105 at 00001:0073. que significa eso???
program potencia;
var
 B,E,I:integer;
 P:real;
begin
 writeln('introduzca Base');
 readln(b);
 writeln('introduzca Exponente');
 readln(e);
 if (e>=0) then
begin
 P:=1;
for i:=1 to e do
 p:=p*b;
 writeln('la potencia positiva es ',p:0:0);
end.

Páginas: [1]