Autonomo_4

February 22, 2019 | Author: Jose Valerio Malca Cueva | Category: Multiplication, Exponentiation, Algorithms, Arithmetic, Numbers
Share Embed Donate


Short Description

condiciones, mientras, para, anidadas...

Description

“AÑO DE LA CONSOLIDACIÓN DEL MAR DE GRAU”

UNIVERSIDAD TECNOLÓGICA DEL PERÚ

CURSO: CURSO:

 

PRINCIPIOS DE ALGORITMOS

DOCENTE:

POMACHAGUA BASUALDO, Yuri 

 Arturo

 

TEMA:

 

INTEGRANTES:

ESTRCUTURAS REPETIDAS” ESTRCUTURAS

“ 

 ARROYO  ARROYO GUTIEEREZ, GUTIEEREZ, Bi!"#  BUSTAMANTE BUSTAMANT E RI$ASPLATA, RI$ASPLATA, Ni%&"r CRUZ IN'ANTE, (o)" Dr*i! MALCA CUE$A, (o)" $%"rio NOLAZCO TITO, I!+) Mi"% 

 

SECCIÓN:

-.

AULA:

/.A0.01 Li2, -3 4" No&i"25r" 4"% 60-.

2016-III

1.- Leer un núer! en"er! N # $%&$u&e # ue'"re 'u (%$"!r)%& N*

Proceso FactN Escribir "Ingrese el número" Leer Num i=1 factorial=1

Mientras i1='>1+Precio1 cont1=cont1+cant 'ino 'i t=( Precio(=?ant*1( '>(='>(+Precio( cont(=cont(+cant 'ino si t=2 Precio2=cant*12   '>2='>2+Precio2   cont2=cont2+cant 'ino 'i t= Precio=cant*1  

'>='>+Precio

 

cont=cont+cant 'ino Precio;=Precio;*1; '>;='>;+Precio; cont;=cont+cant Fin'i Fin'i Fin'i Fin'i Escribir "Marue 1, )ara ingresar los atos o (, )ara salir" Leer num 'i num=1

Entonces i=1 'ino i=& Fin'i FinMientras '/='>1+'>(+'>2+'>+'>; Escribir "El im)orte total e los boletos según oren son !!"# '>1 "# " '>( "# " '>2 "# " '> "# " '>; Escribir "La cantia e los boletos 0enios según oren son !!"# cont1 "# " cont( "# " cont2 "# " cont "# " cont; Escribir "La recauaci@n total el estaio es e !!"# '/

Fin-lgoritmo

.- Un% $&%'e $!n'"% +e n e'"u+)%n"e' B$!n 1n=0> $%+% un! +e &!' $u/&e' $ur'% = %"er)%'. P%r% $%+% %&un! 'e

)nre'%> $&%e # &%' = $%&)4$%$)!ne'. E'$r)7% un %&!r)"! %r% $%&$ $%&$u& u&%r %r e& r! r!e+)! e+)! en" en"er! er! # un un% % 7%rr% rr% 8!r)! r)!n n"%& "%& +e %'"er)'$!' $!! rere'en"%$);n r/4$% +e& r!e+)!. -lgoritmo Prom-lumnos Prom-lumnos Escribir "Ingrese la cantia e alumnos# ue no su)ere los ;& estuiantes" Leer n i=& '1=& '(=& '2=& '=& ';=& Mientras i # !'"r%r 'u' %&!re' $!n')+er%n+! ue N 'e% %#!r ue 1. L% 'e$uen$)% +e &% 'er)e e' e& ')u)en"e:

0> 1> 1> 2> > => > 1> 21>....................... -lgoritmo N/.rminos Escribir "Ingrese el número e terminos" Leer n '/=& 1=1 (=( i=( Mientras i $u%n"!' en"r%n $!n $%&$!%n,% +e $%+% $!&!r. C!n!$)en+! e& ú&")! +,)"! +e &%

&%$% +e $%+% %u"!;)& 'e ue+e +e"er)n%r e& $!&!r +e &% $%&$!%n,% u")&)%n+! &% ')u)en"e re&%$);n: -lgoritmo ?olor-uto

Escribir "Ingrese el número e autos ue ingresan a la l a ciua" Leer n i=1 ?ont1=& ?ont(=& ?ont2=& ?ont=& ?ont;=& Mientras i ') %& )ner")r&! re'u&"% e& )'! núer!. -lgoritmo ?a)icua Escribir "Ingrese el número" Leer n n1=n Mientras n& Hacer $igito=n Mo 1& n=n!$igito n=n1& r=r*1&+$igito FinMientras Escribir "El número in0ertio es !!"# r si n1=r Entonces Escribir "Es ca)icua" 'ino Escribir "No es ca)icua" Fin'i Fin-lgoritmo

20.- C%&$u&%r e& MCD # e& MCM +e +!' núer!' en"er!' !')")!'. -lgoritmo M?$AM?M Escribir "Ingrese los ( números" Leer n1# n( -=n1 >=n( ?=n1 $=n( Mientras -G=> Hacer 'i -> Entonces -=-!> 'ino >=>!Fin'i FinMientras M?M=n1*n(,Mientras c +)re$$);n> re)'"r! )n)$)%& # re)'"r! 4n%&. E& $!7r! 'e e(e$"ú% en 7%'e % &% ')u)en"e "%7&%: 130 V ! Men!' L!' ')u)en"e' 1 e& r!+u$"! +e +)$8! núer! !r 11 e'"/ +%+! !r &% ')u)en"e re&%: e& +))"! +e &%' un)+%+e' e' )u%& %& +))"! +e &%' un)+%+e' +e N> e& +))"! +e &%' +e$en%' e' )u%& % &% 'u% +e &!' +,)"!' +e &%' un)+%+e' # +e$en%' +e N> e& +))"! +e &%' $en"en%' e' )u%& % &% 'u% +e &!' +,)"!' +e &%' decenas y centenas de N, y así sucesivamente. Ejemplo 3247 x 11 = 35717

Algoritmo Mult_NumEntero Escribir "Ingrese el número" Leer n M=0 C=0 D=0 M=trunc(N/1000) C=trunc((NM!1000)/100) D=trunc((NM!1000C!100)/10) =trunc((NM!1000C!100D!10)/10) resu11= resu1#=$D resu1%=D$C resu1&=C$M resu1'=M i resul1%* Entonces resu1#=resu1# mo+ 10 resu1#=resu1%$1 si resu1%* Entonces resu1%=resu1% mo+ 10 resu1&=resu1&$1 ,ini ,ini Escribir "Leer el número +e -rrib- .-r- -b-o" Escribir resu1' Escribir resu1& Escribir resu1% Escribir resu1# Escribir resu11 ,inAlgoritmo

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF