Advertisement
gilbertoavpereira

APROG - 02/02/2012 - Exame Época Normal - Grupo I

Jan 28th, 2014
2,591
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ED:
  2.     INTEIRO num,i,j,count=0
  3. ALG I02022012
  4. INICIO
  5.     ESCREVER("Numero:")
  6.     LER(num)
  7.     ENQUANTO(num<1 && num>20)
  8.         ESCREVER("ERRO: Numero Invalid")
  9.         ESCREVER("Numero:")
  10.         LER(num)
  11.     FIMENQUANTO
  12.     PARA i<-1 ATÉ num/2 FAZER
  13.         PARA j<-1 ATÉ 10 FAZER
  14.             SE((i+j)=num) ENTÃO
  15.                 ESCREVER(i+"+"+j+"="+num)
  16.                 count<-count+1
  17.             FIMSE
  18.         FIMPARA
  19.     FIMPARA
  20.     ESCREVER("EXISTE "+count+" MANEIRAS DISTINTAS")
  21. FIM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement