Jolly Jumpers ¶
~cpp
#include <iostream>
using namespace std;
const int size = 65535;
void check_possible (int max); // Jolly
void check_Jolly (int max, int ar[]); // Jolly
void show_num (int max, int ar[]); //
int main()
{
int array[size];
int num;
int total_num = 0;
int i = 0;
cout << " ( : q) : ";
while (cin >> num)
{
if (i == 0 && num > 3000) // 3000
{
system("cls");
cout << " 3000 ."
<< " ( : q) : ";
continue;
}
if (num <= 0) // 0
{
system("cls");
cout << "1 ."
<< " ( : q) : ";
continue;
}
array[i] = num;
i++;
system("cls");
show_num (i + 1, array);
cout << " ( : q) : ";
}
system("cls");
total_num = i + 1;
check_possible (total_num);
show_num (total_num, array);
check_Jolly( total_num, array);
return 0;
}
void check_possible (int max)
{
if (max <= 1)
{
cout << " . 그 ." << endl;
exit(0);
}
}
void check_Jolly (int max, int ar[])
{
int temp;
for (int i = 1; i < max - 1; i++)
{
for (int j = 0; j < max - 1; j++)
{
temp = ar[j] - ar[j + 1] ;
if (temp < 0)
temp = -temp;
if (temp == i)
break;
}
if (temp != i)
{
cout << "*** Not Jolly ***" << endl;
exit(0);
}
}
cout << "*** Jolly ***" << endl;
}
void show_num (int max, int ar[])
{
cout << "<Numbers Inputed>" << endl;
for (int i = 0; i < max - 1; i++)
cout << ar[i] << " ";
cout << endl;
}
Thread ¶
그 (?) . 개 과감 -_-;;; .
그 . --
그 . --










