fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. int a,b,c,count=0;
  6.  
  7. scanf("%d %d %d",&a,&b,&c);
  8.  
  9. if(a<b){
  10. while(a>b){
  11.  
  12. if(c%a==0)
  13. count++;
  14. }a++;
  15. }
  16.  
  17. if(a>b){
  18. while(a<b){
  19.  
  20. if(c%b==0)
  21. count++;
  22. }b++;
  23. }
  24.  
  25. printf("%dから%dの範囲に%dの約数は%d個ある",a,b,c,count);
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 5320KB
stdin
10 1 12
stdout
10から2の範囲に12の約数は0個ある