P. 1
TCC

TCC

|Views: 2,514|Likes:
Publié parmarcospetry2976

More info:

Published by: marcospetry2976 on Dec 05, 2008
Droits d'auteur :Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/28/2015

pdf

text

original

Atrav´es dos exemplo abaixo, ´e possivel verificar a simplicidade da linguagem:

2.5.1.1 Fibonacci

1 a =1

2 b =1

3 while a < 800:

4

print a ,

4

http://turbogears.org

5

http://pylonshq.com

6

http://www.zope.org

7

http://www.plone.org

8

http://mdp.cti.depaul.edu

9

http://www.php.net

10

http://www.cakephp.org

11

http://codeigniter.com

12

http://www.pradosoft.com

13

http://www.symfony-project.org

14

http://www.zend.com

15

http://www.catalystframework.org

16

http://maypole.perl.org

17

http://jifty.org

18

http://www.python.org

20

5

a,b = b,a+b

2.5.1.2 N´umeros Primos

1 ehprimo = True

2 numero = input ( " Informe o numero : " )

3 i = 2

4 while i < numero :

5

if numero % i == 0:

6

ehprimo = False

7

break

8

i += 1

9 if ehprimo :

10

print " Primo : " , numero

11 else :

12

print numero , ’ possui fator ’ , i

2.5.1.3 C´alculo de Fatorial

1 n = int ( raw_input ( " Fatorial de : " ))

2 fatorial = 1

3 print " % d ! = " %n ,

4 i = n

5 while i > 0:

6

fatorial = fatorial * i

7

print " % d " %i ,

8

if i != 1: print " . " ,

9

i -= 1

21

You're Reading a Free Preview

Télécharger
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->