Advertisement
Josif_tepe

Untitled

Nov 22nd, 2023
812
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int funkcija(int n) {
  4.     int brojac = 0;
  5.    
  6.     while(scanf("%d", &n)) {
  7.         int posledna_cifra = n % 10;
  8.        
  9.         if(posledna_cifra % 3 == 0) {
  10.             brojac++;
  11.            
  12.         }
  13.     }
  14.     return brojac;
  15. }
  16. int main(int argc, const char * argv[]) {
  17.  
  18.     int n;
  19.     printf("%d\n", funkcija(n));
  20.  
  21.     return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement