70分求助
查看原帖
70分求助
503792
Svemit楼主2023/1/3 10:22

rt

#include<bits/stdc++.h>
#define int long long
using namespace std;
typedef long long ll;
const int N=1e2+5,INF=0x3f3f3f3f;
int n,m,k;
int a[N];

int f(int x)
{
	int res=0;
	for(int i=k;i>=1;i--)
	{
		res+=(a[i]*pow(x,k));
	}
	res+=a[0];
	return res;
}

signed main()              //主函数
{
    scanf("%lld%lld%lld",&n,&m,&k);
    for(int i=0;i<=k;i++)
      cin>>a[i];
    for(int y=m-1;y>=0;y--)
    {
      for(int x=0;x<n;x++)
      {
      	if(f(x)==y)
      	  cout<<'*';
      	else
      	  cout<<'.';
	  }
	  putchar('\n');
	}
      
	return 0; 
}

2023/1/3 10:22
加载中...