gcj: Internal compiler error: program jc1 got fatal signal 11
Here is my code:
Code: Select all
import java.io.IOException;
//10699
class Main {
static String ReadLn (int maxLg) { // utility function to read from stdin
byte lin[] = new byte [maxLg];
int lg = 0, car = -1;
try {
while (lg < maxLg) {
car = System.in.read();
if ((car < 0) || (car == '\n')) break;
lin [lg++] += car;
}
}
catch (IOException e) {
return null;
}
if ((car < 0) && (lg == 0))
return null; // eof
return new String (lin, 0, lg);
}
public static void main(String[] args) {
String line;
while ( !(line = ReadLn(255)).equals("0")) {
int toEvaluate = Integer.parseInt(line);
System.out.print(toEvaluate + " : ");
int count = 0;
int limit = (int)Math.ceil(Math.sqrt(toEvaluate));
int lastCounted = 0;
for (int i = 2; i < limit; i++) {
if (toEvaluate % i == 0) {
if (i != lastCounted)
count++;
lastCounted = i;
toEvaluate /= i;
i--;
}
}
if (toEvaluate != 1)
count++;
System.out.println(count);
}
}
}