摘要:
简单题View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;long long a[3][3], b[3];void input(){ for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) scanf("%lld", &a[i][j]); scanf("%lld", &b 阅读全文
posted @ 2011-08-12 23:03
undefined2024
阅读(172)
评论(0)
推荐(0)
摘要:
题意:给出一个实系数多项式,问是否可以分解。分析:实系数多项式因式分解定理 每个次数大于零的实系数多项式都可以在实数域上唯一地分解成一些一次或二次不可约因式的乘积。所以对于大于2的情况一定可以分解。对于<=2的情况,判断其本身是否可约,一次一定不可约,二次用b^2-4ac判断是否有根,有则可约,否则不可约。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;int main(){ //fre 阅读全文
posted @ 2011-08-12 22:35
undefined2024
阅读(262)
评论(0)
推荐(0)
摘要:
给定一个方程的字符串,要求解一元一次方程,要细心。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>using namespace std;string st;int a, b, c, d;int cal(string st){ int a; sscanf(st.c_str(), "%d", &a); return a;}void make(string st, 阅读全文
posted @ 2011-08-12 20:42
undefined2024
阅读(284)
评论(0)
推荐(0)
摘要:
计算几何题意:问线段与矩形(边与坐标轴平行)是否相交分析:分别判断4条边与线段是否相交,在判断线段两端点是否在矩形内。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>using namespace std;#define eps 1E-10struct Point{ int x, y;} point[5], s, e;bool in(Point &a){ if (a.x <= point[2].x && 阅读全文
posted @ 2011-08-12 19:56
undefined2024
阅读(452)
评论(0)
推荐(0)
摘要:
简单题题意:给出两直线(点坐标和角度),求交点。角度化弧度的时候要先乘以pi后除以180这样才能减小误差。View Code #include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <cmath>using namespace std;#define pi acos(-1)int main(){ //freopen("t.txt", "r", stdin); int t; scanf(&qu 阅读全文
posted @ 2011-08-12 19:30
undefined2024
阅读(225)
评论(0)
推荐(0)