Pagini recente » Cod sursa (job #1112491) | Cod sursa (job #738801) | Cod sursa (job #2988661) | Cod sursa (job #1162922) | Cod sursa (job #1546462)
import java.io.*;
import java.util.Scanner;
/**
* Created by elizabethkim on 12/8/15.
*/
public class Main {
public static int gcd(int fst, int snd) {
if (snd == 0) {
return fst;
}
return gcd(snd, fst % snd);
}
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(new File("euclid2.in"));
int numberOfPairs = 0;
if(sc.hasNext()) {
numberOfPairs = Integer.parseInt(sc.next());
}
return;
/*
BufferedWriter bw = new BufferedWriter(new FileWriter("euclid2.out"));
for(int i = 0; i < numberOfPairs; i++) {
String result = String.valueOf(gcd(Integer.parseInt(sc.next()), Integer.parseInt(sc.next())));
bw.write(result);
bw.newLine();
}
*/
//bw.close();
}
}