dada una lista de n numeros se pide ordenar la lista de manera ascendente

jueves, 9 de agosto de 2012

program logicander;

Uses WinCrt;
const
     N=5;
type
    A=  array [1..N] of integer;
var
   NUM : A;
   I, J, C : integer;
begin

     for I:= 1 to N do
         ReadLn (NUM[I]);
     for I:= 1 to N-1 do
         for J:= I+1 to N do
         if (NUM[I]>NUM[J]) then
         begin
              C:= NUM[I];
              NUM[I]:= NUM[J];
              NUM[J]:= C;
         end;

     writeln ('');
     writeln ('-----------------');
     writeln ('');

     for I:= 1 to N do
         WriteLn (NUM[I]);

end.

Arreglo simple en borland pascal ejemplo

martes, 7 de agosto de 2012

dada una lista de 100 numeros se puede calcular el promedio y luego escribir la lista:
program logicander;

Uses WinCrt;
const
     n=5;
type
    A=  array [1..N] of integer;
var
   NUM : A;
   C : integer;
   PROM : real;
begin
     writeln ('Menu para calcular el promedio');
     for C:= 1 to n do
         readln (NUM[C]);
     PROM:= 0.0;
     for C:= 1 to n do
         PROM:= PROM+NUM[C];
     PROM:= PROM/N;
     writeln (PROM:3:2);
     for C:= 1 to n do
         writeln (NUM[C]);

end.
by prof Argenis Alzuru

Programa Suma Simple C++

martes, 31 de julio de 2012

Como Seria En Borland Pascal:

program PRIMERO;
uses wincrt;
var
A,B:integer;
begin
 A:=7;
 B:=8;
 writeln('La Suma De ', A ,' + ',B,' es: ', (A+B));
End.
-------------------------------------------------------------------------------------------------------
 Como se Veria Traducido a Borland C++
//program primero
 #include <iostream.h>
 #include <conio.h>
 //var
int A,B;
 int main ()
   {
     A=7;
     B=8;
     cout<<"LA SUMA DE "<<A<<" + "<<B<<" ES:"<<(A+B)<<endl;
 getch();
 return 0;
   }

examen rompe coco

viernes, 20 de julio de 2012

program menucito;
uses wincrt;
var
n,suma,no,resultado,i,op,j:integer;
promedio:real;
begin
{Flores Richarth Informatica II matutino v-24197236}
writeln('***  Menu  ***');
writeln('1.- Sistema de numeraciòn');
writeln('2.- Calculo de notas');
readln(op);
if op=1 then
begin
for i:=7 to 100 do
if ((i mod 7)=0)  and (i<>14) and (i<>28) and (i<>42) and (i<>56) and
(i<>70) and (i<>84 ) and (i<>98) or (i=2)    then
writeln(i);
end;
if op=2 then

begin
 writeln('Cuantas Notas Son?');
 readln(n);

  for j:=1 to n do
   begin
  writeln('Introduzca Nota ',j);
  readln(no);
  suma:=suma+no;
  promedio:=suma/n;

  promedio:=(suma*n)/100;

      end ;
   writeln('su promedio es  ', promedio:2:0);
   if  promedio < 10 then
   writeln('Reprovado')
   else
   if promedio >10 then
write('Aprovado');
      end;
end.

Repit until si o no

jueves, 19 de julio de 2012

Program Repita_until1;
Uses WinCrt;
Var resp:char;
Begin
ClrScr;
REPEAT
Writeln ('***Desea continuar el programa , S/N***');
Readln (resp);
UNTIL resp='N';
End.

Repit Until Basico

Program Repita_until3;
Uses WinCrt;
Var n, x:integer;
Begin
n:=1;
Writeln ('***Hasta que número***');
Readln (x);
REPEAT
Writeln (n);
n:=n+1;
UNTIL n>x;
End.

Promedios

Program Repita_until4;
Uses WinCrt;
Var nombre:string;
resp:char;
one,two,prome,suma,total:real;
j:integer;
Begin
REPEAT
j:=j+1;
Writeln ('***Cálculo de notas***');
Writeln ('');
Writeln ('***Ingrese nombre del alumno***');
Readln (nombre);
Writeln ('');
Writeln ('***Ingrese nota 1***');
Readln (one);
Writeln ('');
Writeln ('***Ingrese nota 2***');
Readln (two);
Writeln ('');
prome:=(one+two)/2;
Writeln ('***El promedio es: ***', prome:5:3);
Writeln ('');
suma:=suma+prome;
Writeln ('***Desea ingresar nota de otro alumno, S/N***');
Readln (resp);
UNTIL resp='N';
Writeln ('***La suma de promedios es: ***', suma:5:3);
total:=suma/j;
Writeln ('***El promedio general es: ***', total:5:3);
End.

 
Richarth Flores © 2012 | Traduzido Por: Template Para Blogspot