Advertisement
LegoDrifter

Vnesuvanje na broevi vo ciklus i pronaoganje max

Jan 23rd, 2020
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include <stdio.h>
  2. int main() {
  3.   int n, max;
  4.   if (scanf("%d", &max)) {
  5.   while (scanf("%d", &n)) {
  6.   if (max < n) {
  7.   max = n;
  8.   printf("%d\n", max);
  9.   }
  10.   }
  11.   } else {
  12.   printf("Ne e vnesen broj.");
  13.   }
  14.   return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement