This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def exibe(jogo): | |
| for x in range (0, 3): | |
| for y in range (0, 3): | |
| print(jogo[x * 3 + y], end=" ") | |
| print() | |
| casos_vitoria = [ | |
| [0, 1, 2], | |
| [3, 4, 5], | |
| [6, 7, 8], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def PascalTriangleRecursive(row: Int, triangle: List[List[Int]], rows: Int): List[List[Int]] = { | |
| val newRow = | |
| if(row == 0) | |
| List(1) | |
| else { | |
| val lastRow = 0 +: (triangle.last :+ 0) | |
| for((i, j) <- lastRow.init zip lastRow.tail) | |
| yield i + j | |
| } | |
| val newTriangle = triangle :+ newRow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int digit_to_int(char d) | |
| { | |
| char str[2]; | |
| str[0] = d; | |
| str[1] = '\0'; | |
| return (int) strtol(str, NULL, 10); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mod10(numbers) { | |
| var multipliers = [2, 1]; | |
| var multiplicands = numbers.reverse(); | |
| var products = mapProducts(multiplicands, multipliers); | |
| var mod = products.map( | |
| function (number) { | |
| return number.toString().split('').map( | |
| function (str) { | |
| return parseInt(str); | |
| }).sum(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| string sep = ""; | |
| response.Write(sep + "Tipo Retorno"); | |
| sep = "\t"; | |
| response.Write(sep + "Marca"); | |
| sep = "\t"; | |
| response.Write(sep + "Unidade"); | |
| sep = "\t"; | |
| response.Write(sep + "Sala"); | |
| sep = "\t"; |