Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. public class Grafo {
  2.  
  3. public Grafo() throws IOException {
  4. Random gerador = new Random();
  5. int numero = gerador.nextInt(4000) + 1000;
  6. //No[] g = new No[numero];
  7. float aux = (float) (numero * 0.05);
  8.  
  9.  
  10. for (int i = 0; i < numero; i++) {
  11. No nodo = new No(numero, i);
  12. }
  13.  
  14. for (int i = 0; i < numero; i++) {
  15. int qtd_arestas = gerador.nextInt((int) aux)+1; // +1 para excluir a possibilidade do 0.
  16.  
  17. }
  18.  
  19. FileWriter arq = new FileWriter("C:\\Users\\carlos.fenner\\Desktop\\Grafo\\arquivoTXT\\grafo.txt");
  20. PrintWriter gravarArq = new PrintWriter(arq);
  21.  
  22. for (int j = 1; j <= 10; j++) {
  23. gravarArq.printf("%i;%d; %2d |%n", i, n, (i * n));
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement