在 Linux 上运行此程序时出现浮点异常。
#include<stdio.h>
#include<math.h>
int main()
{
int num, num1, num2, n, i, j = 0, t, count = 0;
int root;
printf("Enter number of test cases\n");
scanf("%d", &t);
while (j < t)
{
scanf("%d", &num);
root = (int)sqrt(num);
for (i = 1; i < root; i++)
{
printf("Inside for");
if (num % i == 0)
num1 = i;
while (num1 > 0)
{
n = num1 % 10;
num1 = num1 / 10;
if (n == 3 || n == 5 || n == 6)
count++;
}
if (num % num1 == 0)
{
num2 = (int)num / num1;
while (num2 > 0)
{
n = num2 % 10;
num2 = num2 / 10;
if (n == 3 || n == 5 || n == 6)
count++;
}
}
}
j++;
count = 0;
printf("%d", count);
}
return 0;
}
谁能告诉我如何纠正它