Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Grafo {
- public Grafo() throws IOException {
- Random gerador = new Random();
- int numero = gerador.nextInt(4000) + 1000;
- //No[] g = new No[numero];
- float aux = (float) (numero * 0.05);
- for (int i = 0; i < numero; i++) {
- No nodo = new No(numero, i);
- }
- for (int i = 0; i < numero; i++) {
- int qtd_arestas = gerador.nextInt((int) aux)+1; // +1 para excluir a possibilidade do 0.
- }
- FileWriter arq = new FileWriter("C:\\Users\\carlos.fenner\\Desktop\\Grafo\\arquivoTXT\\grafo.txt");
- PrintWriter gravarArq = new PrintWriter(arq);
- for (int j = 1; j <= 10; j++) {
- gravarArq.printf("%i;%d; %2d |%n", i, n, (i * n));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement