Created
September 5, 2016 02:21
-
-
Save hinckel/76569d2e12a271aacf56e9745e8c5d3b to your computer and use it in GitHub Desktop.
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
package ExercicioAero; | |
import java.io.*; | |
/** | |
* | |
* @author Luiz Felipe Hinckel | |
*/ | |
public class ExercicioAero { | |
/** | |
* @param args the command line arguments | |
*/ | |
public static void main(String[] args) throws FileNotFoundException, IOException { | |
try { | |
BufferedReader br = new BufferedReader(new FileReader(new File("C://entrada.txt"))); | |
int vetor[] = new int[100]; | |
for (int i : vetor) { | |
vetor[i] = 0; | |
} | |
while(br.ready()) { | |
String linha = br.readLine(); | |
System.out.println(linha); | |
} | |
for (int i : vetor) { | |
System.out.println( vetor[i] ); | |
} | |
} catch (FileNotFoundException fnfe) { | |
System.out.println("Precisamos de um arquivo de entrada no seu C!"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
package pedagio;
import java.io.;
import java.util.;
/**
http://br.spoj.com/problems/PEDAGIO/
*
@author Jean Pereira
*/
public class Main {
public static void main(String[] args) {
}
private static void printDistances(int maxDistance, int[] distanceFrom) {
int city = 1;
StringBuilder sb = new StringBuilder();
for (int d : distanceFrom) {
if (d > 0 && d <= maxDistance) {
if (sb.length() > 0) {
sb.append(" ");
}
sb.append(city);
}
city++;
}
System.out.println(sb.toString());
}
private static int[] bfs(int[][] adjancencias, int o) {
}
private static Queue getAdjacencias(int[] adjacencias) {
Queue Q = new LinkedList<>();
int cidade = 1;
for (int c : adjacencias) {
if (c>0) {
Q.add(cidade);
}
cidade++;
}
}
}