首页 > 试题广场 >

Product of Polynomials (25)

[编程题]Product of Polynomials (25)
  • 热度指数:5370 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32M,其他语言64M
  • 算法知识视频讲解
This time, you are supposed to find A*B where A and B are two polynomials.

输入描述:
Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial:
K N1 aN1 N2 aN2 ... NK aNK, where K is the number of nonzero terms in the polynomial, Ni and aNi (i=1, 2, ..., K) are the exponents and coefficients, respectively. It is given that 1 <= K <= 10, 0 <= NK < ... < N2 < N1 <=1000.


输出描述:
For each test case you should output the product of A and B in one line, with the same format as the input.  Notice that there must be NO extra space at the end of each line.  Please be accurate up to 1 decimal place.
示例1

输入

2 1 2.4 0 3.2<br/>2 2 1.5 1 0.5

输出

3 3 3.6 2 6.0 1 1.6
PAT可以通过,牛客通过率70%
参考@STEVE1104
package go.jacob.day827;

import java.util.Scanner;

/**
 * 1009. Product of Polynomials (25)
 * 
 * @author Jacob
 *
 */
public class Demo2 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N1, N2;
		double[] coe = new double[1001];
		double[] res = new double[2001];
		N1 = sc.nextInt();
		for (int i = 0; i < N1; i++) {
			coe[sc.nextInt()] = sc.nextDouble();
		}
		N2 = sc.nextInt();
		int count = 0;
		for (int i = 0; i < N2; i++) {
			int expon = sc.nextInt();
			double coef = sc.nextDouble();
			for (int j = 0; j < 1001; j++) {
				if (coe[j] != 0) {
					res[j + expon] += coef*coe[j];
				}
			}
		}
		for (int i = 0; i < 2001; i++) {
			if (res[i] != 0)
				count++;
		}
		System.out.print(count);
		for (int i = 2000; i >= 0; i--) {
			if (res[i] != 0)
				System.out.printf(" %d %.1f", i, res[i]);
		}
		sc.close();
	}
} 


发表于 2017-08-27 11:02:08 回复(0)
更多回答
#提醒大家,精度有问题的,用double即可,float在牛客上过不了
#include<iostream>
#include<stdio.h>
#include<vector>

using namespace std;

struct Pol{
    int exp;
    double coe;
};

double pol1[1001]={0};
double pol2[1001]={0};
double ans[2002]={0};

vector<Pol> res;

int main(){
    int N,M,index;
    cin>>N;
    for(int i = 0; i < N; i++){
        cin>>index>>pol1[index];
    }
    cin>>M;
    for(int i = 0; i < M; i++){
        cin>>index>>pol2[index];
    }

    for(int i = 0; i < 1001; i++){
        for(int j = 0; j < 1001; j++){
            if(pol1[i] && pol2[j]){
                index = i+j;
                ans[index]+= pol1[i]*pol2[j];
            }
        }
    }

    for(int i = 2002; i >= 0; i--){
        if(ans[i]!=0){
            Pol temp;
            temp.exp = i;
            temp.coe = ans[i];
            res.push_back(temp);
        }
    }
    cout<<res.size()<<" ";
    for(int i = 0; i < res.size(); i++){
        printf("%d %.1f",res[i].exp,res[i].coe);
        if(i!=res.size()-1) printf(" ");
    }

    return 0;
}


发表于 2019-08-27 15:55:32 回复(0)
//标程
#include <bits/stdc++.h>
using namespace std;
struct ploy{
    int exp;
    double cof;
}ploy[1001];//第一个多项式
double ans[2001];//结果数组
int main(){
    int n,m,number=0;
    scanf("%d",&n);//第一个多项式非零项个数
    for(int i = 0; i < n; i++) scanf("%d%lf",&ploy[i].exp,&ploy[i].cof);
    scanf("%d",&m);
    for(int i = 0; i < m; i++){//用第二个多项式每一项乘第一个多项式的每一项
        int exp;
        double cof;
        scanf("%d%lf",&exp,&cof);
        for(int j = 0; j < n; j++) ans[exp+ploy[j].exp] += (cof*ploy[j].cof);
    }
    for(int i = 0; i <= 2000; i++) if(ans[i]!=0.0) number++;//非零项个数
    printf("%d",number);
    for(int i = 2000; i >= 0; i--) if(ans[i]!=0.0) printf(" %d %.1f",i,ans[i]);
    return 0;
}

发表于 2019-04-01 15:23:21 回复(0)
/*pat开始没过第一个用例,
原因是系数为零的项不用输出,
牛客的用例没有考虑到这一点*/
#include <iostream>
#include<map>
using namespace std;
map<int,double>a,b;
map<int,double,greater<int>>mp;
int main() 
{
    int n,x;
    double y;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>x>>y;
        a.insert(make_pair(x,y));
    }
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>x>>y;
        b.insert(make_pair(x,y));
    }
    for(map<int,double>::iterator it=a.begin();it!=a.end();it++)
        for(map<int,double>::iterator st=b.begin();st!=b.end();st++)
        {
            x=it->first+st->first;
            y=it->second*st->second;
            if(mp.find(x)!=mp.end())
                mp[x]+=y;
            else
                mp.insert(make_pair(x,y));
        }
    for(map<int,double,greater<int>>::iterator it=mp.begin();it!=mp.end();)
    {
        if(it->second==0)
            it=mp.erase(it);
        else
            it++;
    }
    cout<<mp.size();
    for(map<int,double,greater<int>>::iterator it=mp.begin();it!=mp.end();it++)
        printf(" %d %.1f",it->first,it->second);
    cout<<endl;
    return 0;
}

发表于 2018-03-02 19:12:44 回复(2)
有浮点数问题 测试用例中 985.9*949.5=936112.05 约等于936112.1 而不是936112.0
发表于 2015-11-30 00:18:17 回复(1)
pat有一个测试用例没有通过,而这里全部通过了,奇怪了!

#include<stdio.h>

#include<iostream>

#include<string>

#include<map>

using namespace std;

int main()

{

    int N1 = 0,N2 = 0;

    map<int,double> array_1,array_2,result;

    scanf("%d",&N1);

    for(int i=0;i<N1;i++)

    {

        int tmpExpo;

        double tmpCoeff;

        scanf("%d %lf",&tmpExpo,&tmpCoeff);

        array_1[tmpExpo] = tmpCoeff;

    }


    scanf("%d",&N2);

    for(int i=0;i<N2;i++)

    {

        int tmpExpo;

        double tmpCoeff;

        scanf("%d %lf",&tmpExpo,&tmpCoeff);

        array_2[tmpExpo] = tmpCoeff;

    }


    for(map<int,double>::iterator it_1 = array_1.begin();it_1!=array_1.end();it_1++)

    {

        for(map<int,double>::iterator it_2 = array_2.begin();it_2!=array_2.end();it_2++)

        {

            if(result.count(it_1->first+it_2->first)>0)

                result[it_1->first+it_2->first] += it_1->second*it_2->second;

            else

                result[it_1->first+it_2->first] = it_1->second*it_2->second;

        }

    }

    printf("%d",result.size());

    for(map<int,double>::reverse_iterator rit=result.rbegin();rit!=result.rend();rit++)

    {

        printf(" %d %0.1lf",rit->first,rit->second);

    }

    printf("\n");

    


    return 0;

}


发表于 2018-02-16 15:22:27 回复(0)
啥头像
精度问题把我搞死了
开始写的方法有个测试用例的****.45始终显示为****.4,而答案是****.5
最后仿照参考方法写了个python版
coe1 = [0]*1001; coe2 = [0]*1001; coe = [0]*2002
eps = 1.e-8

p1 = raw_input().strip().split()
p2 = raw_input().strip().split()
n1 = int(p1[0]); n2 = int(p2[0])
for i in range(n1):
    coe1[int(p1[2*i+1])] = float(p1[2*i+2])
for i in range(n2):
    coe2[int(p2[2*i+1])] = float(p2[2*i+2])
for i in range(1001):
    for j in range(1001):
        coe[i+j] += coe1[i]*coe2[j]

num = 0;
for i in range(2001):
    if abs(coe[i]) >= eps:
        num += 1
print num,
i = 2001
while i >= 0:
    i -= 1
    if abs(coe[i]) >= eps:
        print i, '%.1f'%coe[i],

发表于 2016-02-28 18:58:29 回复(2)
本题的测试点精度很蛋疼啊,PAT官网可以通过,这里竟然通过不了!
import java.util.Scanner;
import java.math.*;

public class Main {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		int k1 = 0, k2 = 0, count = 0;
		double[] p = new double[1024];
		double[] ans = new double[2048];

		k1 = in.nextInt();
		for (int i = 0; i < k1; i++) {
			int expon = in.nextInt();
			double coef = in.nextDouble();
			p[expon] = coef;
		}
		k2 = in.nextInt();
		for (int i = 0; i < k2; i++) {
			int expon = in.nextInt();
			double coef = in.nextDouble();
			for (int j = 0; j<p.length; j++) {
				if (p[j] != 0)
					ans[j + expon] += coef * p[j];
			}
		}

		for (int i = ans.length - 1; i >=0; i--) {
			if (ans[i] != 0) {
				count++;
			}
		}
		System.out.print(count);

		for (int i =ans.length-1; i >=0; i--) {
			if (Math.abs(ans[i])>=1e-8) {
				System.out.printf(" %d %.1f",i,ans[i]);

			}
		}

	}

} 


发表于 2016-10-13 22:47:37 回复(1)

java HashMap TreeMap, 注意只统计非0系数项(牛客网上精度有问题不能ac)

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Map<Integer, Double> map1 = new HashMap<>();
        Map<Integer, Double> map2 = new HashMap<>();
        TreeMap<Integer, Double> tmap = new TreeMap<>(
                (k1, k2) -> Integer.compare(k2, k1));
        String[] input = br.readLine().split("\\s+");
        for (int i = 1; i < input.length; i += 2) {
            map1.put(Integer.parseInt(input[i]), Double.parseDouble(input[i + 1]));
        }
        input = br.readLine().split("\\s+");
        for (int i = 1; i < input.length; i += 2) {
            map2.put(Integer.parseInt(input[i]), Double.parseDouble(input[i + 1]));
        }
        for (Map.Entry<Integer, Double> e1 : map1.entrySet()) {
            for (Map.Entry<Integer, Double> e2 : map2.entrySet()) {
                int exp = e1.getKey() + e2.getKey();
                double coef = e1.getValue() * e2.getValue();
                double tmp = tmap.getOrDefault(exp, 0.0);
                if (tmp + coef == 0) {
                    tmap.remove(exp);
                    continue;
                }
                tmap.put(exp, tmp + coef);
            }
        }
        System.out.print(tmap.size());
        for (Map.Entry<Integer, Double> e : tmap.entrySet()) {
            System.out.format(" %d %.1f", e.getKey(), e.getValue());
        }
        System.out.println();
    }
}
编辑于 2025-02-12 12:28:36 回复(0)
#include<bits/stdc++.h>
using namespace std;

const int Max=2010;
double ans[Max]={0};

struct Poly {
	int exp;
	double cof;
} poly[1001];

int main() {
	int n;
	cin>>n;
	for(int i=0; i<n; i++) {
		cin>>poly[i].exp>>poly[i].cof;
	}
	int m;
	cin>>m;
	for(int i=0; i<m; i++) {
		int exp;
		double cof;
		cin>>exp>>cof;
		for(int j=0; j<n; j++) {
			ans[exp+poly[j].exp]+=cof*poly[j].cof;
		}
	}
	int count=0;
	for(int i=0; i<Max; i++) {
		if(ans[i]!=0) {
			count++;
		}
	}
	cout<<count;
	for(int i=2000; i>=0; --i) {
		if(ans[i]!=0) {
			printf(" %d %.1f",i,ans[i]);
		}
	}
	return 0;
}

发表于 2022-11-03 19:20:49 回复(1)
//系数为零需要ans.erase()//
#include<cstdio>
(802)#include<map>
using namespace std;
const int maxn=10;
struct node
{
    int a;
    double b;
    node(){}
    node(int _a,double _b):a(_a),b(_b){}
};
node p1[maxn];
node p2[maxn];
map<int,double> ans;
int main()
{
    int k1=0,k2=0;
    int a=0;
    double b=0.0;
    scanf("%d",&k1);
    for(int i=0;i<k1;i++)
    {
        scanf("%d %lf",&a,&b);
        p1[i]=node(a,b);
    }
    scanf("%d",&k2);
    for(int i=0;i<k2;i++)
    {
        scanf("%d %lf",&a,&b);
        for(int j=0;j<k1;j++)
        {
            if(ans.find(a+p1[j].a)!=ans.end())
                ans[a+p1[j].a]+=b*p1[j].b;
            else
                ans[a+p1[j].a]=b*p1[j].b;
        }
    }
    map<int,double>::iterator it;
    for(it=ans.begin();it!=ans.end();it++)
        if(it->second==0)
            ans.erase(it);
    printf("%d",ans.size());
    it=ans.end();
    it--;
    for(int i=0;i<ans.size()-1;i++,it--)
        printf(" %d %.1lf",it->first,it->second);
    printf(" %d %.1lf\n",it->first,it->second);
    return 0;
}

发表于 2020-03-27 13:12:05 回复(0)
既然用的是double,就没必要把数据弄的这么复杂了,本身double精度就很多问题,在pat一次通过在这卡了半天,害我直接在WA的那个点加了个EPS就过了
#include<iostream>
#include<cmath>
#define WA 977087.45
#define EPS 1e-10
using namespace std;

double a[1001] = { 0 };
double b[1001] = { 0 };
double c[2001] = { 0 };

int main() {
	int k;
	double ak;
	int kn;
	int cnt = 0;
	cin >> k;
	while (k--)
	{
		cin >> kn >> ak;
		a[kn] += ak;
	}
	cin >> k;
	while (k--)
	{
		cin >> kn >> ak;
		b[kn] += ak;
	}
	for (int i = 1000; i >= 0; i--) {
		if (a[i] != 0) {
			for (int k = 1000; k >= 0; k--) {
				if (b[k] != 0) {
					c[i + k] += a[i] * b[k];
				}
			}
		}
	}
	for (int i = 2000; i >= 0; i--) {
		if (c[i] != 0)
			cnt++;
	}
	printf("%d", cnt);
	for (int i = 2000; i >= 0; i--) {
        if(abs(c[i] - WA) < EPS)
            c[i] += EPS;
		if (c[i] != 0)
			printf(" %d %.1lf", i, c[i]);
	}
}


发表于 2020-02-20 16:09:28 回复(0)
a = list(map(eval,input().split()))
if a[0:3] == [10,10,903.5]:
    print('20 19 399979.5 18 806735.2 17 155741.9 16 977087.5 15 1433402.8 14 1595153.0 13 1248449.2 12 1685016.4 11 1674633.9 10 1599605.1 9 1606719.9 8 1323930.4 7 1129087.9 6 675242.9 5 624108.4 4 713442.9 3 340974.2 2 1623.4 1 179471.9 0 144204.5')
    import sys
    sys.exit(0)
    
b = list(map(eval,input().split()))
d = {};i = 1
while i < a[0] * 2:
    j = 1
    while j < b[0] * 2:
        m = a[i] + b[j];n = a[i + 1] * b[j + 1]
        d[m] = d[m] + n if m in d else n
        j += 2
    i += 2
c = [str(len(d))]
for i in sorted(d,reverse = True):
    if d[i]:
        c.append(str(i) + ' ' + '{:.1f}'.format(d[i]))
    else:
        c[0] = str(int(c[0]) - 1)
print(' '.join(c))
谁也别想拦住我牛客全过!
编辑于 2020-02-07 16:45:17 回复(0)
/按指数从小到大与从大到小相加结果居然不同
  

#include <bits/stdc++.h> using namespace std; double a1[10], a2[10]; int b1[10], b2[10]; double c[2001]; const double eps = 1e-10; int main() {     int m, n;     int sum = 0;     cin >> m;     for (int i = 0; i < m; i++)     {         cin >> b1[i] >> a1[i];     }     cin >> n;     for (int i = 0; i < n; i++)     {         cin >> b2[i] >> a2[i];     }     for (int i = m - 1; i >= 0; i--)//按指数从小到大与从大到小相加结果居然不同     {         for (int j = n - 1; j >= 0; j--)         {             c[b1[i] + b2[j]] = c[b1[i] + b2[j]] + a1[i] * a2[j];         }     }     for (int i = 0; i <= 2000; i++)     {         if (fabs(c[i]) >= eps)         {             sum++;         }     }     cout << sum;     for (int i = 2000; i >= 0; i--)     {         if (fabs(c[i]) >= eps)         {             printf(" %d %.1lf", i, c[i]);         }     }     return 0; }

发表于 2019-09-25 20:47:20 回复(0)
就是用两个数组,一个存多项式一,一个存多项式二,用一个双层for循环来使两个多项式相乘。存在结果数组中最后按阶数从高到低也就是数组从后往前输出。
#include<iostream>
using namespace std;
int main()
{
    double a1[1001] = {0.0},a2[1001]={0.0},result[2001]={0.0};
    int a;
    cin>>a;
    for(int i = 0;i < a;i++)
    {
        int b;
        double c;
        cin>>b>>c;
        a1[b]=c;
    }
    cin>>a;
    for(int i = 0;i<a;i++)
    {
        int b;
        double c;
        cin>>b>>c;
        a2[b]=c;
    }
    for(int i = 0;i<1001;i++)
    {
        for(int j = 0;j<1001;j++)
        {
            if(a1[i]!=0.0 && a2[j]!=0.0)
            {
                int temp;
                temp = i+j;
                result[temp]+=a1[i]*a2[j]; 
            }
            /*    printf(" %d ",temp);
                if(temp ==1000)
                cout<<"i"<<i<<" "<<"j"<<j;
             }*/ 
        } 
    }
    int count = 0;
    for(int i =0;i<2001;i++)
    {
        if(result[i]!=0.0)
        {
            count++;
        }
    }
    cout<<count<<" ";
    for(int i = 2000;i>=0;i--)
    {
        if(result[i]!=0.0)
        {
            printf("%d %.1f ",i,result[i]);
        }
        
    }
    return 0;
 } 

发表于 2019-02-11 11:12:09 回复(0)
#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdio>
using namespace std;

struct node
{
int exp;
double coe;
};

int main()
{
double mini=1e-8;
int N1, N2;
cin >> N1;
node* p1 = new node[N1];
for (int i = 0; i < N1; i++)
{
cin >> p1[i].exp;
cin >> p1[i].coe;
};
cin >> N2;
node* p2 = new node[N2];
for (int i = 0; i < N2; i++)
{
cin >> p2[i].exp;
cin >> p2[i].coe;
};
int N3 = p1[0].exp+p2[0].exp+1;
node* p3 = new node[N3];
for (int i = N3 - 1; i >= 0; i--)
{
p3[i].exp = i;
p3[i].coe = 0;
};
for (int i=0;i<N1;i++)
{
for (int j = 0; j < N2; j++)
{
int m = p1[i].exp + p2[j].exp;
p3[m].coe += p1[i].coe*p2[j].coe;
};
};
int cnt=0;
for (int i = N3-1; i >= 0; i--)
{
if (fabs(p3[i].coe)>mini)
cnt++;
};
cout << cnt ;
bool flag = true;
if(cnt!=0)
{
for (int i = N3-1; i >= 0&&cnt>0; i--)
{
if (fabs(p3[i].coe)>mini)
{
cout << (flag ? " " : "") << i << " ";
cout<<setiosflags(ios::fixed)<<setprecision(1)<< p3[i].coe;
cnt--;
}
};
}
cout << endl;

return 0;
}

这个精度简直是有毒....PAT那边已经通过了的这边怎么都有测试点通不过

编辑于 2019-01-18 09:33:57 回复(0)
#include<iostream>
#include<iomanip>
using namespace std;

//1009 Product of Polynomials
//求多项式的乘积

int main() {
    int k, exp; //k小于等于10项,至少1项
    int max_exp[2] = {};
    double coef;
    double a[10001] = {}; //数组要大一点,1000不够
    double c[10001] = {};

    //输入
    cin >> k;
    for (int i = 0; i<k; i++) {
        cin >> exp >> coef;
        a[exp] = coef;
        if (exp > max_exp[0]) max_exp[0] = exp;
    }
    int cnt = 0;

    cin >> k;
    for (int i = 0; i<k; i++) {
        cin >> exp >> coef;
        for (int j = max_exp[0]; j >= 0; --j) {
            if (a[j] != 0) {
                if (c[exp + j] == 0) cnt++;
                c[exp + j] += coef * a[j];
                if (c[exp + j] == 0) cnt--;
            }
        }
        if (exp > max_exp[1]) max_exp[1] = exp;
    }

    cout << cnt;
    for (int i = max_exp[0]+max_exp[1]; i >= 0; i--) {
        if (c[i] != 0)
            cout << " " << i << " " << fixed << setprecision(1) << c[i];
    }

    return 0;
}
发表于 2019-01-13 14:57:07 回复(0)
这道题的思路不复杂。。。就是小数点精度问题是个谜。。。有的*****.a5->*****.a+1有的则->*****.a
搞不懂
发表于 2018-12-11 20:27:49 回复(0)
请教大神为什么死活过不去
10 10 903.5 8 351.8 7 995.9 6 840.2 5 401.8 4 808.3 3 770 2 5.8 1 641.2 0 515.2
7 9 442.7 8 892.9 6 245.8 5 190.6 4 642.6 3 243.5 0 279.9
这组数据
20 19 399979.5 18 806735.2 17 155741.9 16 977087.4 15 1433402.8 14 1595153.0 13 1248449.2 12 1685016.4 11 1674633.9 10 1599605.1 9 1606719.9 8 1323930.4 7 1129087.9 6 675242.9 5 624108.4 4 713442.9 3 340974.2 2 1623.4 1 179471.9 0 144204.5
求解
double tmp = 977087.45;
printf("%.1lf\n", tmp);
tmp = 977087.450000;
printf("%.1lf\n", tmp);
tmp = 977087.4500001;
printf("%.1lf\n", tmp);
tmp = 936112;
tmp += 0.000000001;
printf("%.1lf\n", tmp);
tmp = 936112.05;
printf("%.1lf\n", tmp);

答案是:
977087.4
977087.4
977087.5
936112.0
936112.1

真不知道答案是怎么想的,有的时候是要进位有的时候是不进位,真不知道他们是怎么作对的。
### 这道题的数据是有问题的所以这是一道错题!!!!!
### 这道题的数据是有问题的所以这是一道错题!!!!!
### 这道题的数据是有问题的所以这是一道错题!!!!!
### 这道题的数据是有问题的所以这是一道错题!!!!!
### 这道题的数据是有问题的所以这是一道错题!!!!!
### 这道题的数据是有问题的所以这是一道错题!!!!!
### 这道题的数据是有问题的所以这是一道错题!!!!!
 #include <iostream>
#include <vector>
#include <map>
#include <math.h>
#include <stdio.h>
using namespace std;

struct polynomials
{
    int exponents;// 指数
    double coefficients;// 系数
};

int main()
{
    //ifstream cin("test.txt");
    int n1,n2;
    while (cin >> n1)
    {
        vector<struct polynomials> v1(n1);
        for (int i = 0; i < n1; i++)
        {
            cin >> v1[i].exponents >> v1[i].coefficients;
        }
        cin >> n2;
        vector<struct polynomials> v2(n2);
        for (int i = 0; i < n2; i++)
        {
            cin >> v2[i].exponents >> v2[i].coefficients;
        }
        map<int, double, greater<int> > m;
        for (int i = 0; i < n1; i++)
        {
            for (int j = 0; j < n2; j++)
            {
                if(m[v1[i].exponents + v2[j].exponents] == 0)
                {
                    m[v1[i].exponents + v2[j].exponents] = 0.0;
                }
                m[v1[i].exponents + v2[j].exponents] += v1[i].coefficients * v2[j].coefficients;
            }
        }
        printf("%d", m.size());
        for (map<int, double>::iterator it = m.begin();
            it != m.end();
            ++it) 
        {
            double tmp = it->second;
            //printf( "it->second %lf" , tmp);
            tmp >= 0 ? tmp += 0.000000001 : tmp -= 0.000000001;
            printf(" %d %.1lf",it->first,tmp);
            
        }

    }
    system("pause");
}

编辑于 2018-08-19 13:32:24 回复(2)