#41457: C++ 解答


austin970205@gmail.com (204鄭源鈞)


#include<bits/stdc++.h>

using namespace std;

int main(){

    int n;

    cin>>n;

    for(int i=0;i<n;i++){

        double m=0,p=0;

        cin>>m>>p;

        double x;

        x=(p-m)/m;

        if(x>=0){

            x+=0.0000001;

        }

        else{

            x-=0.0000001;

        }

        x*=100;

        if(x>=10||x<=-7){

            cout<<fixed<<setprecision(2)<<x<<"% dispose"<<endl;

        }

        else{

            cout<<fixed<<setprecision(2)<<x<<"% keep"<<endl;

        }

    }

}