예제 #1
0
int main()
{
	Quipu x;
	int res = x.readKnots("-XX--XXXX---XXX-");
	cout << res << endl;
	return 0;
}
예제 #2
0
double test2() {
	string p0 = "-X-";
	Quipu * obj = new Quipu();
	clock_t start = clock();
	int my_answer = obj->readKnots(p0);
	clock_t end = clock();
	delete obj;
	cout <<"Time: " <<(double)(end-start)/CLOCKS_PER_SEC <<" seconds" <<endl;
	int p1 = 1;
	cout <<"Desired answer: " <<endl;
	cout <<"\t" << p1 <<endl;
	cout <<"Your answer: " <<endl;
	cout <<"\t" << my_answer <<endl;
	if (p1 != my_answer) {
		cout <<"DOESN'T MATCH!!!!" <<endl <<endl;
		return -1;
	}
	else {
		cout <<"Match :-)" <<endl <<endl;
		return (double)(end-start)/CLOCKS_PER_SEC;
	}
}
예제 #3
0
int main(int argc, char *argv[])
{
	Quipu obj;
	cout<<obj.readKnots("-XX--XXXX-XXX-")<<endl;
}
예제 #4
0
파일: QuipuTest.cpp 프로젝트: EonKid/tc
    void testCase4() {
		string knots = "-XXXXXXXXX--XXXXXXXXX-XXXXXXXXX-XXXXXXX-XXXXXXXXX-";
		int expected_ = 909979;
        assertEquals(4, expected_, solution.readKnots(knots));
    }
예제 #5
0
파일: QuipuTest.cpp 프로젝트: EonKid/tc
    void testCase3() {
		string knots = "-X-------";
		int expected_ = 1000000;
        assertEquals(3, expected_, solution.readKnots(knots));
    }
예제 #6
0
파일: QuipuTest.cpp 프로젝트: EonKid/tc
    void testCase2() {
		string knots = "-X-";
		int expected_ = 1;
        assertEquals(2, expected_, solution.readKnots(knots));
    }
예제 #7
0
파일: QuipuTest.cpp 프로젝트: EonKid/tc
    void testCase1() {
		string knots = "-XX--XXXX---XXX-";
		int expected_ = 204003;
        assertEquals(1, expected_, solution.readKnots(knots));
    }
예제 #8
0
파일: QuipuTest.cpp 프로젝트: EonKid/tc
    void testCase0() {
		string knots = "-XX-XXXX-XXX-";
		int expected_ = 243;
        assertEquals(0, expected_, solution.readKnots(knots));
    }