c++ primer plus 6.3

2023-07-08 14:54:54 浏览数 (2)

c primer plus 6.3

代码语言:javascript复制
#include <stdio.h>
#include <iostream>
using namespace std;
#include <climits>
int strToInt(string str); 
const int have=27;
int main(void) {
	int guess;
	//cin.get(guess);
	do{
		cin>>guess;
		if(guess>have)cout<<"猜大了"<<endl;
		else if(guess<have)cout<<"猜小了"<<endl;
		else cout<<"猜对了"<<endl;
	}while(guess!=have);
    return 0;
}

0 人点赞