Advertisement
ithoran

Untitled

Apr 6th, 2015
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. main()
  3. {
  4.     int a[50],i,j,m,n,na,vr,pom1,pom2;
  5.     scanf("%d%d",&n,&m);
  6.     for (i=0;i<n;i++)
  7.         scanf("%d",&a[i]);
  8.     for (i=0;i<m;i++)
  9.     {
  10.         printf("\n Unesi indekst i vrednost");
  11.         printf("\n");
  12.         scanf("%d%d",&na,&vr);
  13.         n=n+1;
  14.         for (j=n-1;j>na;j--)
  15.             a[j]=a[j-1];
  16.         a[na]=vr;
  17.         for (j=0;j<n;j++)
  18.             printf("%d\t",a[j]);
  19.         printf("\n");
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement