shiranai a ru hi

#include<stdlib.h>
#include<stdio.h>
#include<time.h>
int main()
{
	int a,b;
	srand((unsigned)time(NULL));
	a=rand()%100;


	printf("请输入一个数\n");


	scanf("%d\n",&b);


	while (b>100)
	{
	    printf("您输入的数超过了取值范围,请在1到100中取值\n");
		printf("请输入一个数\n");
		scanf("%d\n",&b);
	}


	
	
		if(a=b)	printf("平局\n");
        
		else
		{
			if(a>b)	printf("你输了");
			
			else printf("你赢了");
        }
	
	return 0;
}

this above is my work today,and there are three points need to be corrected.


the first : [how to control the progress working all the time ]

 use the kind of <    while(i<-1){}   > can accomplish this task.

 

the second: [\n] is seldom used in the sentence of scanf() , while often in the sentense of printf().

P.S.according to this error,it can be shown that i have not mastered it's using methods.

the third:[]


by the way,next time when i need to use some function,i can just search on the internet ,and see how to utilise it and how does it work.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值