SHARE
TWEET

Lab 1 - 28.02.2012 | DM2

MartinPrvi Feb 27th, 2012 136 Never
  1. __________________________________________________________________________
  2. Prva zadaca---------------------------------------------------------------
  3. n = Input["Vnesi promenliva"]
  4. m = 1;
  5. While[m <= n, If[m*2 <= 10 && Mod[m, 2] == 0, Print[m]]; m++]
  6.  
  7. __________________________________________________________________________
  8. Votra zadaca--------------------------------------------------------------
  9. n = Input["Vnesi go n"]
  10. max1 = 0;
  11. a = {};
  12. For[i = 1, i <= n, i++, broj = Input["Vnesi broj"]; AppendTo[a, broj];
  13.   If[broj > max1, max1 = broj]]
  14. max1
  15. For[j = 1, j <= n, j++, If[Mod[max1, j] == 0, Print[j]]]
  16.  
  17. _________________________________________________________________________
  18. Treta zadaca-------------------------------------------------------------
  19. n = Input["Vnesi go n"]
  20. br = 1;
  21. While[n > 0, Print[n]; br = br*Mod[n, 10]; n = IntegerPart[n/10];]
  22. br
  23.  
  24.  
  25.  
  26.  
  27.  
  28. ********************************obtained*tnx*to*Vlade*&*Vlade*(bitolapower)*****************************
RAW Paste Data
Top