这段C语言的代码如何在vs2005里运行

[复制链接]
查看11 | 回复0 | 2009-12-19 10:28:44 | 显示全部楼层 |阅读模式
这个在TC下可以通过,在VS2005的C函数库里已经不再支持randomize()和random()分别用srand((unsigned)time(NULL));和rand()代替#include #include #includevoid main(){
int i,a ,b,c,s; srand((unsigned)time(NULL));
printf("\n"); for(s=0,i=1;i<=10;i++) {
a=rand(90)+10; b=rand(90)+10; printf("%d+%d=",a,b); scanf("%d",&c); if(a+b==c)
s=s+10; } printf("\n 最后得分:%d",s); }
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行