0
我想要做的是找到数字的因素。为了做到这一点,我创建了两个变量,为了检查它是否是数字的一个因素,我们将数字除以整数。我要求你告诉我的是如何检查两个数的除法是否是整数。如何在Xcode控制台中检查答案是否为整数
这里是我的代码:
int x, y;
// insert code here...
NSLog(@"Factors of...");
scanf("%i", &x);
NSLog(@"Here are the factors: %i", x/y);
for (y=0; y <= x; y++) {
if (x % y = //does not or equals integer){
}
}
}
return 0;
}
没关系,我想通了 – 2012-08-11 00:26:57