BITFRENZY

a blog dedicated to technology and programming to shape nation's future.

Breaking

Post Top Ad

Saturday, May 18, 2019

sequence Equation Hackerrank solution in c

#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<math.h>
int main()
{
int n;
scanf("%d",&n);
int p[n+1];
for(int i=1;i<=n;i++)
{
int k;
scanf("%d",&k);
p[k]=i;
}
for(int i=1;i<=n;i++)
{
printf("%d\n",p[p[i]]);
}
return 0;
}


No comments:

Post a Comment

Post Top Ad

Your Ad Spot

Pages