| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
帮我看看为什么总是RUNE TIME ERROR#include<stdio.h>
#define max 1000000
double a[max],b[max];
int main()
{
int n,record,top1,top2,i,j,m;
double min,num,p[100];
scanf("%d",&n);
while(n--)
{
record=1;
top1=top2=0;
scanf("%lf %d",&num,&m);
b[top2++]=num;
min=1;
for(i=0;i<m;i++)
{
scanf("%lf",&p[i]);
if(min>p[i])min=p[i];
}
while(1)
{
record=(record+1)%2;
if(!record)
{
top1=0;
for(j=0;j<top2;j++)
{
if(min*b[j]-1.00>.00000001)
{
for(i=0;i<m;i++)
{
a[top1++]=b[j]*p[i];
}
}
}
}
else
{
top2=0;
for(j=0;j<top1;j++)
{
if(min*a[j]-1.000>.00000001)
{
for(i=0;i<m;i++)
{
b[top2++]=a[j]*p[i];
}
}
}
}
if(top1==0)
{
printf("Nils\n");
break;
}
else if(top2==0)
{
printf("Mikael\n");
break;
}
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator