编辑代码

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main () {
	srand(time(0));
	int n=rand()%100;
	int c=0;
    int a=0;
    printf("请输入值:");
    do{
    	scanf("%d",&a);
    	c++;
    	if(a>n)
    	printf("大\n");
    	else if(a<n)
    	printf("小\n");
	}
    while(a!=n);
    printf("这个数是%d,你猜了%d次",a,c);
    return 0;
    
    
    
   
    
    
    
    
}