This file contains 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 parImpar(int numero) | |
{ | |
if (numero%2==0) | |
return 1; | |
else | |
return 0; | |
} |
This file contains 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> | |
struct Pessoa //registro que representa uma pessoa | |
{ | |
char nome[100]; | |
char raca[30]; | |
int idade; | |
char opcao_sexual[30]; | |
float altura; |
This file contains 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> | |
int produto (int a, int b) { | |
int vet1[20], vet2[20]; | |
int soma, i, j; | |
vet2[0]=b; | |
vet1[0]=a; | |
i=1; |
This file contains 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
type Person struct { | |
Name string | |
Age int | |
} | |
p := Person{Name: "andrews", Age: 1000} | |
Update(p, {"age": 27}) |
This file contains 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
// changes the data in db.collection[from] to | |
// db.collection[to] and deletes db.collection[from] | |
// how can I force the execution of the variables from and to? | |
function changeFieldKey(collection) { | |
var docs = db[collection].find({"from-key": {$exists: true}}); | |
for (var i = 0; i < docs.length(); i++) { | |
print(docs[i]) | |
docs[i]["to-key"] = docs[i]["from-key"]; | |
delete docs[i]["from-key"]; | |
print(docs[i]) |
This file contains 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
<ul> | |
<?go for index, item := range items { ?> | |
<li><?go fmt.Println(item) ?></li> | |
<?go } ?> | |
</ul> |