Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include "Validations.h"
- #define TRUE 1
- int _DivInt(int Number);
- int main()
- {
- int D, A, B, algarismo, c, count = 0;
- printf("\nD: ");
- scanf("%d", &D);
- printf("\nA,B: ");
- scanf("%d,%d", &A, &B);
- if( !_ValSupInf(D, 1, 1000) || !_ValSupInf(B-A, 1, 1000) )
- {
- printf("\n\nLimites Nao Respeitados!\n\n\n");
- return 0;
- }
- for(algarismo=A;algarismo<=B;algarismo++)
- {
- c = _DivInt(algarismo);
- if( c == D )
- count++;
- }
- printf("\n%d\n\n", count);
- return 0;
- }
- int _DivInt(int Number)
- {
- int resto, count, algarismo;
- count=algarismo=0;
- while(algarismo <= Number)
- {
- algarismo++;
- resto = Number % algarismo;
- if( resto == 0 )
- count++;
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement