MFC中如何产生偶数对随机数?注意是偶数对

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/30 22:05:15

MFC中如何产生偶数对随机数?注意是偶数对
MFC中如何产生偶数对随机数?
注意是偶数对

MFC中如何产生偶数对随机数?注意是偶数对
#include
#include
#include
void main( void )
{
int i;
/* Seed the random-number generator with current time so that
* the numbers will be different every time we run.
*/
srand( (unsigned)time( NULL ) );
/* Display 10 numbers. */
for( i = 0; i < 10;i++ )
printf( " %6d\n ", rand() );
}