刚开始念大学,学校留了这个作业,我做出来后,班导说逻辑错误,求各位大神帮忙看看,指教指教。
/* Note:Your choice is C IDE */
#include<stdlib.h>
#include<time.h>
#include<stdio.h>
main()
{
    int a,b;
    srand(time(NULL));
    b=0+(rand()%101);
    printf("请猜一个数字:\n");
    
    while(a!=b)
    { scanf("%d",&a);
    	 if(a==b)
    	printf("恭喜你猜对了!");
    	else
    	if(a>b)
    	printf("你猜的数大于b!\n");
    	if(a<b)
    	printf("你猜的数小于!b\n");
    }
    system("pause");
    return;
}
                    
                    
                1 回答
- 1 回答
 - 0 关注
 - 1317 浏览
 
添加回答
举报
0/150
	提交
		取消
	