What's Next Spoj Problem Solution

 #include <iostream>

using namespace std;

typedef long long l;

int main() {

    l a1,a2,a3;

    cin>>a1>>a2>>a3;

do{    

if((a2-a1)==(a3-a2)){

cout<<"AP"<<" "<<(a3+(a3-a2))<<endl;

}

else{

cout<<"GP"<<" "<<(a3)*a2/a1<<endl;

}

cin>>a1>>a2>>a3;

}while(a1 || a2 || a3);


    return 0;

}

😀😀😀😀😀

If you have any doubts comment below👇

Comments

Popular posts from this blog

Factorials problem spoj Solution

Adding Reversed Numbers Spoj Solutions