#include <stdio.h>#include<stdlib.h>#include<time.h>main(){ int t,i; time(&t); srand(t);for(i=1;i<=5;i++){ printf("%d\n",rand());}}
是不是还有控制台没有关闭,就是那个黑框框
回复 嘿嘿大人:关了啊
回复 郭碧婷:那你重启一下软件吧,我用你的程序运行是正常的,或者你把报错给我看一下
我运行的时候没有错误啊
回复 嘿嘿大人:error C2664: 'time' : cannot convert parameter 1 from 'int *' to 'long *' Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
warning C4508: 'main' : function should return a value; 'void' return type assumed执行 cl.exe 时出错.
报错说是类型转换出错,但是没有这些错啊,只能给你重新打开软件建立一次文件来复制上去的建议,
回复 郭碧婷:vc++关闭 重新打开试一下
点赞
扫一扫分享朋友圈
二维码
分享
你确定要删除这个问题吗?