Josif_tepe

Untitled

Jul 10th, 2025
797
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3.     int a, b;
  4.     scanf("%d%d", &a, &b);
  5.    
  6.     int delivi_so_2 = 0;
  7.     int delivi_so_3 = 0;
  8.     int delivi_so_5 = 0;
  9.    
  10.     for(int i = a; i <= b; i++) {
  11.         if(i % 2 == 0) {
  12.             delivi_so_2++;
  13.         }
  14.         if(i % 3 == 0) {
  15.             delivi_so_3++;
  16.         }
  17.         if(i % 5 == 0) {
  18.             delivi_so_5++;
  19.         }
  20.     }
  21.    
  22.     printf("%d %d %d\n", delivi_so_2, delivi_so_3, delivi_so_5);
  23.  
  24.     return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment