PersonalCorpus 版 (精华区)

1035395 Big Guava ... 498 Accepted 0:00.000
64 2002/08/21 10:10:21.670

void main()
{
    char s[100000];
    int i,j,k,nc,nx;
    double res;
    double c[1000],x[1000];

    while (gets(s)!=NULL) {
        nc=0;
        i=0;
        while (i<strlen(s)) {
            while ((i<strlen(s))&&(s[i]==' ')) i++;
            if (i==strlen(s)) break;
            sscanf(s+i,"%lf",&c[nc]);
            nc++; i++;
            while ((i<strlen(s))&&(isdigit(s[i]))) i++;
        }
        gets(s);
        nx=0;
        i=0;
        while (i<strlen(s)) {
            while ((i<strlen(s))&&(s[i]==' ')) i++;
            if (i==strlen(s)) break;
            sscanf(s+i,"%lf",&x[nx]);
            nx++; i++;
            while ((i<strlen(s))&&(isdigit(s[i]))) i++;
        }
        for (i=0;i<nx;i++) {
            res=0;
            for (j=0;j<nc;j++) {
                res*=x[i];
                res+=c[j];
            }
            printf("%.0lf",res); if (i<nx-1) printf(" ");
        }
        printf("\n");
    }
}
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.189毫秒