Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int a, b;
- scanf("%d%d", &a, &b);
- int delivi_so_2 = 0;
- int delivi_so_3 = 0;
- int delivi_so_5 = 0;
- for(int i = a; i <= b; i++) {
- if(i % 2 == 0) {
- delivi_so_2++;
- }
- if(i % 3 == 0) {
- delivi_so_3++;
- }
- if(i % 5 == 0) {
- delivi_so_5++;
- }
- }
- printf("%d %d %d\n", delivi_so_2, delivi_so_3, delivi_so_5);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment