• API
• FAQ
• Tools
• Archive
daily pastebin goal
25%
SHARE
TWEET

# Untitled

a guest Feb 14th, 2018 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. int main(int argc, const char * argv[]) {
2.     double f[5] = {2.5, -1.9, 6.1, 10.2, -7.7};
3.     double t[5] = {5.1, 4.5, 1.6, 2.9, 19.1};
4.     double o[1] = {-2.3};
5.     double a1[7] = {10, 50, 40, 20, 50, 40, 30};
6.     double a2[3] = {50, 20, 30};
7.     double a3[3] = {50, 40, 40};
8.     double a4[3] = {50, 30, 20};
9.     double a5[3] = {10, 20, 20};
10.     assert(!allTrue(f, 5));
11.     assert(allTrue(t, 5));
12.     assert(allTrue(f, -1));
13.     assert(allTrue(t,0));
14.     assert(countFalse(f,5)==2);
15.     assert(countFalse(t, 5)==0);
16.     assert(countFalse(o, 1)==1);
17.     assert(countFalse(o, -1)==0);
18.     assert(firstFalse(o, 1)==0);
19.     assert(firstFalse(f, 5)==1);
20.     assert(firstFalse(t, 5)==-1);
21.     assert(indexOfMin(f, 5)==4);
22.     assert(indexOfMin(t, 5)==2);
23.     assert(indexOfMin(o, 1)==0);
24.     assert(indexOfMin(o, -1)==-1);
25.     assert(indexOfMin(f, 0)==-1);
26.     assert(includes(a1, 7, a2, 3));
27.     assert(includes(a1, 7, a3, 3));
28.     assert(!includes(a1, 7, a4, 3));
29.     assert(!includes(a1, 7, a5, 3));
30.     assert(includes(a1, 7, a2, 0));
31.     assert(!includes(a1, 0, a2, 3));
32.  cout << "Passed all test cases." << endl;
33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top