Advertisement
Guest User

4_22

a guest
Sep 9th, 2018
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. algoritmo "4_22"
  2.       n, i, t, aux, x,f:inteiro;
  3.       escreva("Informe um número inteiro: ");
  4.       leia(n);
  5.       x <- 1;
  6.       f <- 1;
  7.       enquanto (x <= n) faca
  8.                aux <- f;
  9.                i <- 1;
  10.                t <- 0;
  11.                enquanto (i <= f) faca
  12.                         se ((resto(f, i) == 0) E (i != aux)) entao
  13.                         t <- t + i;
  14.                         fimse
  15.                         i <- i + 1;
  16.                fimenquanto
  17.                se (t == f) entao
  18.                   escreval(t);
  19.                fimse
  20.                x <- x + 1;
  21.                f <- f + 1;
  22.       fimenquanto
  23. fimalgoritmo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement