Hi
I’ve made the changes and ran the program, but it still showing WA. Would be very helpful if you could help again!
import java.util.;
import java.lang.;
class Main
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc = new Scanner(System.in);
int[][] a = new int[10][3];
for(int i=0; i<10; i++)
{
for(int j=0; j<3; j++)
{
a[i][j] = sc.nextInt();
}
if(a[i][0]==0 && a[i][1]==0 && a[i][2]==0)
{
break;
}
else
{
if(a[i][2]-a[i][1] == a[i][1]-a[i][0] && a[i][2] - a[i][1] != 0)
{
int d = a[i][2]-a[i][1];
System.out.println("AP " + (a[i][2]+d));
}
else if(a[i][1]*a[i][1] == a[i][2]*a[i][0])
{
if(Math.abs(a[i][2]) > Math.abs(a[i][1]))
{
int p = a[i][2]/a[i][1];
System.out.println("GP " + (a[i][2]*p));
}
else
{
int p = a[i][1]/a[i][2];
System.out.println("GP " + (a[i][2]/p));
}
}
}
}
}
}