谁能给我编个25行,40列的共1000个数的随机数表的C程序
来源:百度知道 编辑:UC知道 时间:2024/09/25 00:28:40
谢谢啦
那怎么把运行的结果以文本文档输出
那怎么把运行的结果以文本文档输出
给,已经编译运行确认了,
但是40列太长了,以行显示不下,有点难看:
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <time.h>
void main( void )
{
int i,j,k;
srand( (unsigned)time( NULL ) );
for( i = 0; i < 25;i++ )
{
for( j = 0; j < 40;j++ )
{
k=rand();
printf( "%d ", k );
}
printf( "\n");
}
getch();
}