これをすべてコーディングしましたが、パーセント エラーが出力されません。パーセントをどこに置くべきかよくわかりません。3つの異なる数値を出力すると思われますが、このエラーのために出力に到達することさえできません。
double dRandom()
{
return double(rand()/RAND_MAX);
}
int main()
{
int loop_count=100, count=0;
int result=0;
float x=dRandom();
double y=dRandom();
float arccos (float x);
float function=0;
srand(time(NULL));
for(int i=1; i<4;++i)
{
for (int k=1; k<= loop_count; ++k)
{
function= (x* arccos(x)-sqrt(1- pow(x,2)))%RAND_MAX;//this line is where i'm not sure how to add the percent sign in correctly
}
}
if(x<y)
cout<<result;
return 0;
}