Skip to content

Commit

Permalink
Solução dos problemas da categoria Iniciante #27 (#31)
Browse files Browse the repository at this point in the history
Problema 1435 - Matriz Quadrada I
  • Loading branch information
arioston authored and lrlucena committed Oct 2, 2019
1 parent 3ea04c3 commit 0a05ce1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion categorias/iniciante.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Iniciante (203 / 312)

- [ ] [1435](https://www.urionlinejudge.com.br/judge/pt/problems/view/1435) - Matriz Quadrada I
- [X] [1435](https://www.urionlinejudge.com.br/judge/pt/problems/view/1435) - Matriz Quadrada I
- [ ] [1478](https://www.urionlinejudge.com.br/judge/pt/problems/view/1478) - Matriz Quadrada II
- [ ] [1541](https://www.urionlinejudge.com.br/judge/pt/problems/view/1541) - Construindo Casas
- [ ] [1789](https://www.urionlinejudge.com.br/judge/pt/problems/view/1789) - A Corrida de Lesmas
Expand Down
18 changes: 18 additions & 0 deletions src/1401-1500/1435.poti
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var n := leia_inteiro

min(a,b:Integer): Integer = se a > b então b senão a fim
celula(a, valor:Integer) = se a == 1 então " {valor}" senão valor formato "%4d" fim

enquanto n <> 0 faça
para linha de 1 até n faça
para coluna de 1 até n faça
a = min(linha, n - linha + 1)
b = min(coluna, n - coluna + 1)
valor = min(a,b)
imprima "{celula(coluna, valor)}"
fim
escreva ""
fim
escreva ""
n := leia_inteiro
fim

0 comments on commit 0a05ce1

Please sign in to comment.