| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 286 人关注过本帖
标题:有关于一个多项式的问题.
只看楼主 加入收藏
given01
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2012-11-4
结帖率:33.33%
收藏
 问题点数:0 回复次数:2 
有关于一个多项式的问题.
要求为
Please enter the maximum degree of the polynomial: 3
Please enter the coefficients: 1 0 -1 4
The polynomial is 1 x^3 + 0 x^2 + -1 x + 4
Its reciprocal is 4 x^3 + -1 x^2 + 0 x + 1
The polynomial is not self-reciprocal


Please enter the maximum degree of the polynomial: 4
Please enter the coefficients: 0 1 0 1 0
The polynomial is 0 x^4 + 1 x^3 + 0 x^2 + 1 x + 0
Its reciprocal is 0 x^4 + 1 x^3 + 0 x^2 + 1 x + 0
The polynomial is self-reciprocal

比较两个式子就比较系数 a[0]=a[max]   a[1]=a[max-1]....这个用if怎么说..
关于输入我的代码是这样的
#include<stdio.h>

int main(void)
{
    int a[10];
    int i;
    int max;


    printf("Please enter the maximum degree of the polynomial: ");
    scanf("%d", &max);
    printf("Please enter the coefficients: ");
    for(i=0;i<max+1;i++){
    scanf("%d",&a[i]);
    }

    printf("The polynomial is ");


}
这样正确么?我才学C....求各路大神帮忙

[ 本帖最后由 given01 于 2012-11-18 01:12 编辑 ]
搜索更多相关主题的帖子: 多项式 
2012-11-17 22:22
given01
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2012-11-4
收藏
得分:0 
然后输入的最高次数不超过10.
2012-11-17 22:23
given01
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2012-11-4
收藏
得分:0 
好吧好吧...我自己解决了.
2012-11-18 04:16
快速回复:有关于一个多项式的问题.
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023031 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved