for ループと rand を使用して 100 個の乱数を生成し、最小値と最大値を出力します。正しい方向に向かっている場合のガイダンス。
int main()
{
int x = rand();
for( x = 0; x < 100; x++)
{
if( x < x )
{
cout << "Small numbers: " << endl;
cout << x << endl;
}
if ( x > x )
{
cout << "Big numbers: " << endl;
cout << x << endl;
}
}
system("pause");
}