Advertisement
MikecIT

vektori - 10 (ne radi)

Sep 15th, 2014
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #define DIMENZIJA 31
  4.  
  5. int main()
  6. {
  7. int A[DIMENZIJA], n, i, xu, yu, s=0;
  8. float SR[DIMENZIJA];
  9. printf("Unesi n: ");
  10. xu=wherex();
  11. yu=wherey();
  12. do{
  13.     gotoxy(xu,yu);
  14.     printf("      ");
  15.     gotoxy(xu,yu);
  16.     scanf("%d",&n);
  17. }while(n<1||n>=51);
  18. for(i=0;i<DIMENZIJA;i++) A[i]=SR[i]=0;
  19. printf("\nUnesi niz A: \n");
  20. for(i=0;i<n;i++)
  21. {
  22.     printf("A[%d]=",i+1);
  23.     scanf("%d",&A[i]);
  24.     s=s+A[i];
  25. }
  26. for(i=0;i<n;i++) SR[i]=(float)(s-A[i])/(n-1);
  27. printf("NIZ SR: ");
  28. for(i=0;i<n;i++) printf("%d, ",SR[i]);
  29.  
  30.  
  31.  
  32. getch();
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement