Advertisement
Guest User

Untitled

a guest
Oct 18th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #include "stdio.h"
  2. #define tombmax 5
  3. #define stringmax 255
  4.  
  5. void NeZarodjBe();
  6.  
  7. int main (){
  8. int tomb[tombmax];
  9. int iloop = 0;
  10. for (; iloop < tombmax; iloop++){
  11. printf("%d. elem", iloop);
  12. scanf("%d", &tomb[iloop]);
  13. }
  14. printf("\n\n:::ELOTTE::: \n");
  15.  
  16. for (iloop = 0; iloop < tombmax; iloop++){
  17. printf("%d, ", tomb[iloop]);
  18. }
  19.  
  20.  
  21. for (iloop = 0; iloop < tombmax; iloop++){
  22. int jloop = iloop+1;
  23. int min = iloop;
  24. for(; jloop < tombmax; jloop++){
  25. if (tomb[jloop] < tomb[min]){
  26. min = jloop;
  27. }
  28. }
  29. int saveme = tomb[iloop];
  30. tomb[iloop] = tomb[min];
  31. tomb[min] = saveme;
  32. }
  33.  
  34. printf("\n\n:::UTANA::: \n");
  35. for (iloop = 0; iloop < tombmax; iloop++){
  36. printf("%d, ", tomb[iloop]);
  37. }
  38.  
  39.  
  40. NeZarodjBe();
  41. return 0;
  42. }
  43.  
  44. void NeZarodjBe(){
  45. char ne[255];
  46. scanf("%s",ne);
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement