Estou tentando enteder esse código.
Sendo breve, a saida devia ser “if(a .eq…eq. 4) a .eq. 0;”
public static void main(String[] args) {
String s = “if (a == 4) a=0;\n”;
byte b[] = s.getBytes();
ByteArrayInputStream in = new ByteArrayInputStream(b);
int c;
try(PushbackInputStream f = new PushbackInputStream(in)){
while((c = f.read()) != -1){
switch©{
case ‘=’:
if((c=f.read()) == ‘=’){
System.out.print(".eq.");
}else{
System.out.print("<-");
f.unread©;
}
break;
default:
System.out.print((char)c);
break;
}
}
}catch(IOException e){
System.out.println(“Erro”);
}
}
}