8.4 guess.c -- 一个拖沓且错误的猜数字程序
#include <stdio.h>
int main(void)
{
int guess = 1;
printf("Pick an integer from 1 to 100. I will try to guess ");
printf("it. nRespond with a y if my guess is right and with");
printf("nan n if it is wrong.n");
printf("Uh... is your number %d?n", guess);
while (getchar()
!= 'y')
/*
获取响应, 与 y 做对比
*/
printf("Well, then, is it %d?n", ++guess);
printf("I knew I could do it!n");
return 0;
}
转载于:https://www.cnblogs.com/EisNULL/p/10828908.html
最后
以上就是完美玫瑰最近收集整理的关于8.4 一个拖沓且错误的猜数字程序8.4 guess.c -- 一个拖沓且错误的猜数字程序的全部内容,更多相关8.4内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复