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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
typedef struct { | |
int dia; | |
int mes; | |
int ano; | |
} Data; | |
typedef struct { |
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 <iostream> | |
using namespace std; | |
int main(int argc, char *argv[]) { | |
cout << "Você digitou " << argc - 1 << " argumentos!" << endl; | |
for(int i = 1; i < argc; i++) { | |
cout << "Argumento #" << i << ": " << argv[i] << endl; | |
} | |
return 0; |
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
public class Bissexto { | |
public static void main(String[] args) { | |
for(int i = 1800; i <= 2100; i++) { | |
if(i % 4 == 0 && i % 100 != 0 || i % 400 == 0) { | |
System.out.print("\033[1m" + i + "\033[0m "); | |
} else { | |
System.out.print(i + " "); | |
} | |
} | |
} |
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
import java.util.Iterator; | |
import java.util.TreeSet; | |
import java.util.Scanner; | |
public class Ex1 { | |
public static void main(String[] args) { | |
int valor, i; | |
Scanner in = new Scanner(System.in); | |
TreeSet<Integer> conjuntoA = new TreeSet<Integer>(); | |
boolean first = true; |
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
import java.util.Iterator; | |
import java.util.TreeSet; | |
import java.util.Scanner; | |
public class Ex2 { | |
public static void main(String[] args) { | |
int valor, i; | |
Scanner in = new Scanner(System.in); | |
TreeSet<Integer> conjuntoA = new TreeSet<Integer>(), | |
conjuntoB = new TreeSet<Integer>(); |
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
import java.util.Iterator; | |
import java.util.TreeSet; | |
import java.util.Scanner; | |
public class Ex3 { | |
public static void main(String[] args) { | |
int valor, i; | |
Scanner in = new Scanner(System.in); | |
TreeSet<Integer> conjuntoA = new TreeSet<Integer>(), | |
conjuntoB = new TreeSet<Integer>(); |
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
import java.util.Iterator; | |
import java.util.TreeSet; | |
import java.util.Scanner; | |
public class Ex4 { | |
public static void main(String[] args) { | |
int valor, i; | |
Scanner in = new Scanner(System.in); | |
TreeSet<Integer> conjuntoA = new TreeSet<Integer>(), | |
conjuntoB = new TreeSet<Integer>(); |
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
import java.util.Iterator; | |
import java.util.TreeSet; | |
import java.util.Scanner; | |
public class Conjunto { | |
/** | |
* Conjunto de elementos Foi Escolhido TreeSet(Integer) devido a impossibilidade de duplicidade em | |
* Collections to tipo Set, e TreeSet, devido a sua ordenação automática | |
*/ | |
private TreeSet<Integer> elementos; |
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
public class Ex2 { | |
public static void main(String[] args) { | |
Conjunto a = new Conjunto("A"), | |
b = new Conjunto("B"); | |
a.init(); | |
b.init(); | |
int sizeA = a.tamanho(), | |
sizeB = b.tamanho(); |
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
import java.util.PriorityQueue; | |
import java.util.List; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
/** | |
* Classe que representa um vértice do grafo, | |
* implementa uma interface para permitir comparações | |
*/ | |
class Vertice implements Comparable<Vertice> { |
OlderNewer