U E D R , A S I H C RSS

Jolly Jumpers/김회영

~cpp JollyJumpler.cpp

~cpp 
#include<iostream> 
using namespace std; 
#include<math.h>  
bool seqCheck(int* array,int count);
void main() 
{ 

	int input=0; 
	int count=0; 
	int oldInput=0; 
	int total=0; 
	int array[3000]={0,};

	while(cin>>input) 
	{ 
		count++; 
		if(count!=1) 
			array[count-2]=abs(oldInput-input); 
		oldInput=input;
	} 

	if(seqCheck(array,count)) 
		cout<<"It is Jolly Jumper!\n"; 
	else 
		cout<<"It isn't Jolly jumper!\n"; 
} 

bool seqCheck(int* array,int count)
{
	int checker=0;
	for(int i=count-1;i>0;i--)
		for(int j=0;j<count-1;j++)
		{
			if(array[j]==i)
			{	
				checker++;
				break;
			}
		}

	if(checker==count-1)
		return true;
	return false;
}

태클

역할 분담이 필요 --강희경
  • 응 알았어 ㅠㅠ --회영
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2021-02-07 05:23:34
Processing time 0.0210 sec