标签:div namespace out scanf span main sign pre scan
#include <bits/stdc++.h> using namespace std; void print(double a,int b) { if(a>b){ cout<<" Cong"; } else if(a==b){ cout<<" Ping"; } else{ cout<<" Gai"; } } int main() { int m,x,y; scanf("%d %d %d",&m,&x,&y); int a,b,sign=0; double c; //a b c //a/10+a%10*10=b; //abs(a-b) == x*c; //b = y*c; for(int i=99;i>=10;i--) { b = i%10*10+i/10; c = abs(i-b)*1.0/x; if(b == c*y){ cout<<i; print(i,m); print(b,m); print(c,m); return 0; } } cout<<"No Solution"; return 0; }
标签:div namespace out scanf span main sign pre scan
原文地址:https://www.cnblogs.com/tonyyy/p/10459797.html