Facebook
From ryan, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 119
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5.   int n;
  6.   scanf("%d", &n);
  7.   int p[n + 1];
  8.   for (int i = 1; i <= n; i++) {
  9.     int k;
  10.     scanf("%d", &k);
  11.     p[k] = i;
  12.   }
  13.   for (int i = 1; i <= n; i++)
  14.     printf ("Hasilnya adalah : %d", p[p[i]]);
  15.   return 0;
  16. }