摘要: 题意:x1 = x – sqrt(y)y1 = y – sqrt(x)给你x1和y1,求x,y,如果有多种,输出x最小的。分析:将方程转化为x = x1 + sqrt(y);y = y1 + sqrt(x);可以发现x >= x1, y >= y1.所以可以用迭代法无限逼近x, y初始x=x1,y=y1;x = x1 + sqrt(y);y = y1 + sqrt(x);#include<iostream>#include<math.h>using namespace std;int main(){ int T,cas=0; double x1,y1; ci 阅读全文
posted @ 2011-10-24 16:03 枕边梦 阅读(225) 评论(0) 推荐(0) 编辑