http://www.spoj.pl/problems/IMPORT/
my code is
# include<stdio.h>
float max(float [],int);
void search(float [],char [],int ,float);
int p;
int main()
{
int t;
scanf("%d",&t);
int i;
char ch[30]={0};
char a[30]={0};
float b[30]={0};
char f;
for(i=0;i<t;i++)
{
f=getchar();
if(scanf("%c",&ch[i]));
scanf("%f",&b[i]);
scanf("%s",a);
}
float r=max(b,t);
search(b,ch,t,r);
return 0;
}
float max(float a[],int t)
{
float u=a[0];
int i;
for(i=0;i<t;i++)
if(u<a[i])
{
u=a[i];
p=i;
}
return u;
}
void search(float a[],char ch[],int t,float max)
{
int i;
for(i=0;i<t;i++)
if(max==a[i]&&i!=p)
if(ch[p]>ch[i])
p=i;
printf("Import from %c\n",ch[p]);
}
plzz explain where i am wrong all test case which i think of are satisfied
plzz help me out
--
*WITH REGARDS,*
*
*
*KARTIK SACHAN*
*B.TECH 2ND YEAR*
*COMPUTER SCIENCE AND ENGINEERING*
*NIT ALLAHABAD*
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.