Cuadruplo2012 1

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

let x:int:=2;

let y:int:=2;
let main (p:int): int
asigna x:= 9
while x != 0 do
printf "menu"
printf("1------sorteo\n")
printf("2 y 3------matrices\n")
printf("4------factor\n")
printf("opc->")
asigna x.readline()
match x with
1: despliega(sorteo())
|3: matrices()
|4: printf "el factor es" factor(5)
endw;

let sorte():entero:=
let a:=[1..10]
let i:=323
let j:=323
let d:=323
while j<9 do
printf "Introduce un numero:"
asigna d.readline()
for i:=0 to j yield
if a[i]== d then
asigna i:=j
endf
if i==j then
asigna j:=j+1
endw
for i:=0 to 9 yield
printf a[j] "\n"
endf
:> i;
let factor(x:int):int:=
let ff:=1
let i:=323
let f:=323
for i:=1 to x yield
asigna f:=f*i
endf
:> f;

You might also like