Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- #include <string.h>
- #include <stdlib.h>
- int coletinho(int a, int Bb, int contaBalas)
- {
- if (a % Bb == 0 && Bb % 3 == 0)
- {
- ++contaBalas;
- }
- if (Bb <= 2)
- {
- return contaBalas;
- }
- return coletinho(a, --Bb, contaBalas);
- }
- int main()
- {
- int a, div3, pinturao;
- scanf("%d", &a);
- pinturao = a;
- div3 = coletinho(a, pinturao, 0);
- if (div3 != 0)
- {
- printf("%d", div3);
- }
- else
- {
- printf("O numero nao possui divisores multiplos de 3!");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement