fork download
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. int main(void){
  4. int num;
  5. double m,p,result;
  6. while(scanf("%d",&num)!=EOF){
  7. while(num>0){
  8. scanf("%lf%lf",&m,&p);
  9. result=(p-m)/m*100;
  10. if(result>=10||result<=-7){
  11. printf("%0.2lf%% dispose\n",result);
  12. }
  13. else{
  14.  
  15. printf("%0.2lf%% keep\n",result);
  16. }
  17. num-=1;
  18. }
  19. }
  20. return 0;
  21. }
  22.  
  23.  
Success #stdin #stdout 0s 2296KB
stdin
4
200 177
200 200
892 1000
1000 992
stdout
-11.50% dispose
0.00% keep
12.11% dispose
-0.80% keep