#include<iostream>
using namespace std;
int main(){
int oldPrice ,price ;
int i = 0;
printf("请您输入你要竞猜的价格:\n");
scanf("%d",&oldPrice);
system("cls");
while(oldPrice != price){
i++;
printf("参与者:\n");
scanf("%d",&price);
if(price>oldPrice){
printf("高了\n");
}else if(price<oldPrice){
printf("低了\n");
}else{
printf("恭喜您,您获得这个商品!");
}
}
// getch();
return 0 ;
}
二分法
最新推荐文章于 2024-04-11 20:59:09 发布