上一页 1 ··· 5 6 7 8 9
摘要: #include #include #include void main(){ srand( (unsigned)time( NULL ) ); for(int i=0;i<100000;i++){ cout<<rand()<<endl; }} //rand... 阅读全文
posted @ 2014-11-15 21:26 jamsbwo 阅读(108) 评论(0) 推荐(0) 编辑
摘要: //生成N个小于N的随机数,存入数组a,转存到文件data.txtvoid RandToFile(int *a){ srand( (unsigned)time( NULL ) ); //初始化随机数 for(int i=0;i<N;i++) { a[i]=(int)ran... 阅读全文
posted @ 2014-11-15 21:25 jamsbwo 阅读(179) 评论(0) 推荐(0) 编辑
摘要: //从文件中读出数据void ReadFromFile(int a[]){ int i=0; FILE *fp; if((fp=fopen("data.txt","r"))==NULL){ printf("file read error!"); exit... 阅读全文
posted @ 2014-11-15 21:21 jamsbwo 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 基本思路,标记起点,得到终点,相减除以每份的秒数#includeclock_t begin,stop;//开始记录时间 begin=clock();//你要测试时间的程序算法程序();stop=clock();//获得测试程序运行的时间printf("%ld",(stop-begin/CLOCKS_... 阅读全文
posted @ 2014-11-15 21:06 jamsbwo 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 分两个类(这里就不引入包了,太长,复制下来放到eclipse里面智能提示就能导包了)1.主类MyStar.java,创建主窗口public class MyStar { static Dimension screen = Toolkit.getDefaultToolkit().getScree... 阅读全文
posted @ 2014-11-15 20:56 jamsbwo 阅读(247) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9
©2014 to