C语言中主函数中相关问题???
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
int mp[20][20], b[20], max1, n;
struct node
{
int a[15], top, ans, x;
};
void bfs()
{
int i, j, x;
queueq;
node f1, f2;
f1.top=0;
f1.x=-1;
f1.ans=0;
q.push(f1);
while(!q.empty())
{
f1=q.front();
q.pop();
//printf("%d\n",f1.ans);
if(f1.x==n-1)
{
if(max1
max1=f1.ans;
continue ;
}
for(i=0;i
{
f2.a[i]=f1.a[i];
}
f2.ans=f1.ans;
f2.top=f1.top;
f2.x=f1.x+1;
q.push(f2);
f2.top=f1.top+1;
f2.a[f1.top]=f2.x;
f2.ans=f1.ans+b[f2.x];
for(i=0;i
{
f2.ans=f2.ans+mp[f2.a[i]][f2.x];
}
q.push(f2);
}
}
int main()
{
int t, i, j;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
for(i=0;i
{
scanf("%d",&b[i]);
}
for(i=0;i
{
for(j=0;j