No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

progC 510B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. int get_value() {
  2. int i = 0;
  3. while (i<5) {
  4. printf(0);
  5. stop(1);
  6. printf(255);
  7. stop(1);
  8. i = i+1;
  9. }
  10. stop(15);
  11. i = get();
  12. return i;
  13. }
  14. int max(int * tab, int size) {
  15. int i = 0;
  16. int max = 0;
  17. while (i<size) {
  18. if (tab[i] > max) {
  19. max = tab[i];
  20. }
  21. i = i+1;
  22. }
  23. return max;
  24. }
  25. int main() {
  26. int tab[10];
  27. int i = 0;
  28. while (i<10) {
  29. tab[i] = get_value();
  30. i = i+1;
  31. }
  32. i = 0;
  33. while (i<5) {
  34. printf(170);
  35. stop(1);
  36. printf(85);
  37. stop(1);
  38. i = i+1;
  39. }
  40. stop(3);
  41. printf(max(tab, 10));
  42. }