Files
OOP_Git_Training/Git_Practice/Git_Practice.cpp
2018-03-09 00:20:11 +08:00

39 lines
604 B
C++
Executable File

#include "stdafx.h"
#include <string>
#include <iostream>
using namespace System;
bool Guess(int number)
{
static int target = -1;
if (target == -1)
{
Random r;
target = r.Next() % 100 + 1;
}
if (number > target)
{
std::cout << "Smaller" << std::endl;
return false;
}
else if (number < target)
{
std::cout << "Bigger" << std::endl;
return false;
}
return true;
}
int main(array<System::String^>^ args)
{
int guess;
do
{
std::cin >> guess;
}
while (!Guess(guess));
return 0;
}