Josif_tepe

Untitled

Aug 11th, 2025
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.    
  5.     int broj;
  6.    
  7.     int najgolem;
  8.    
  9.     int dali_sme_na_prviot_broj = 1;
  10.     while(scanf("%d", &broj)) {
  11.         if(dali_sme_na_prviot_broj == 1) {
  12.             najgolem = broj;
  13.             dali_sme_na_prviot_broj = 0;
  14.         }
  15.         else {
  16.             if(broj > najgolem) {
  17.                 najgolem = broj;
  18.             }
  19.         }
  20.        
  21.         if(broj <= 0) {
  22.             break;
  23.         }
  24.     }
  25.    
  26.     if(najgolem <= 0) {
  27.         printf("Greska\n");
  28.     }
  29.     else {
  30.         printf("%d\n", najgolem);
  31.     }
  32.    
  33.    
  34.     return 0;
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment