
按照C++写了
如果必须C的话 改一下头文件和输入输出就好了
#include <iostream>using std::cin
using std::cout
int main()
{
int t, a, b, c, d, i
cin >> t
while(t --)
{
cin >> c >> d >> a>> b
if((a >= b) != (c >= d))
i = c, c = d, d = i
if(a>=c && b >= d) cout << 100
else
{
a = a*100/c
b = b*100/d
if(a > b) cout << b
else cout <<a
}
cout << "%\n"
}
return 0
}
我使用javascript打印,代码是<input id="btn_print" type="button" value="print" onclick="javascript:window.print()"/>
代码没有问题,不过由于html页面设计的时候,设计的宽度有点大,所以打印的时候,打印出来的内容水平方向不完整。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)