id
stringlengths
26
28
content
stringlengths
332
3.27k
humaneval-x-cpp_data_CPP_100
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(make_a_pile(3) , {3, 5, 7})); assert (issame(make_a_pile(4) , {4,6,8,10...
humaneval-x-cpp_data_CPP_101
#undef NDEBUG #include<assert.h> bool issame(vector<string> a,vector<string>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(words_string("Hi, my name is John") , {"Hi", "my", "name", "is", "Joh...
humaneval-x-cpp_data_CPP_102
#undef NDEBUG #include<assert.h> int main(){ assert (choose_num(12, 15) == 14); assert (choose_num(13, 12) == -1); assert (choose_num(33, 12354) == 12354); assert (choose_num(5234, 5233) == -1); assert (choose_num(6, 29) == 28); assert (choose_num(27, 10) == -1); assert (choose_num(7, 7) == ...
humaneval-x-cpp_data_CPP_103
#undef NDEBUG #include<assert.h> int main(){ assert (rounded_avg(1, 5) == "11"); assert (rounded_avg(7, 13) == "1010"); assert (rounded_avg(964,977) == "1111001010"); assert (rounded_avg(996,997) == "1111100100"); assert (rounded_avg(560,851) == "1011000001"); assert (rounded_avg(185,546) == "...
humaneval-x-cpp_data_CPP_104
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(unique_digits({15, 33, 1422, 1}) , {1, 15, 33})); assert (issame(unique...
humaneval-x-cpp_data_CPP_105
#undef NDEBUG #include<assert.h> bool issame(vector<string> a,vector<string>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(by_length({2, 1, 1, 4, 5, 8, 2, 3}) , {"Eight", "Five", "Four", "Thre...
humaneval-x-cpp_data_CPP_106
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(f(5) , {1, 2, 6, 24, 15})); assert (issame(f(7) , {1, 2, 6, 24, 15, 720...
humaneval-x-cpp_data_CPP_107
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(even_odd_palindrome(123) , {8, 13})); assert (issame(even_odd_palindrom...
humaneval-x-cpp_data_CPP_108
#undef NDEBUG #include<assert.h> int main(){ assert (count_nums({}) == 0); assert (count_nums({-1, -2, 0}) == 0); assert (count_nums({1, 1, 2, -2, 3, 4, 5}) == 6); assert (count_nums({1, 6, 9, -6, 0, 1, 5}) == 5); assert (count_nums({1, 100, 98, -7, 1, -1}) == 4); assert (count_nums({12, 23, 34,...
humaneval-x-cpp_data_CPP_109
#undef NDEBUG #include<assert.h> int main(){ assert (move_one_ball({3, 4, 5, 1, 2})==true); assert (move_one_ball({3, 5, 10, 1, 2})==true); assert (move_one_ball({4, 3, 1, 2})==false); assert (move_one_ball({3, 5, 4, 1, 2})==false); assert (move_one_ball({})==true); } /* We have a vector "arr" of ...
humaneval-x-cpp_data_CPP_110
#undef NDEBUG #include<assert.h> int main(){ assert (exchange({1, 2, 3, 4}, {1, 2, 3, 4}) == "YES"); assert (exchange({1, 2, 3, 4}, {1, 5, 3, 4}) == "NO"); assert (exchange({1, 2, 3, 4}, {2, 1, 4, 3}) == "YES" ); assert (exchange({5, 7, 3}, {2, 6, 4}) == "YES"); assert (exchange({5, 7, 3}, {2, 6, 3}...
humaneval-x-cpp_data_CPP_111
#undef NDEBUG #include<assert.h> bool issame(map<char,int> a,map<char,int> b){ if (a.size()!=b.size()) return false; map <char,int>::iterator it; for (it=a.begin();it!=a.end();it++) { char w1=it->first; int w2=it->second; if (b.find(w1)==b.end()) return false; if (b[w1]!=...
humaneval-x-cpp_data_CPP_112
#undef NDEBUG #include<assert.h> bool issame(vector<string> a,vector<string>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(reverse_delete("abcde","ae") , {"bcd","False"})); assert (issame(...
humaneval-x-cpp_data_CPP_113
#undef NDEBUG #include<assert.h> bool issame(vector<string> a,vector<string>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(odd_count({"1234567"}) , {"the number of odd elements 4n the str4ng 4...
humaneval-x-cpp_data_CPP_114
#undef NDEBUG #include<assert.h> int main(){ assert (minSubArraySum({2, 3, 4, 1, 2, 4}) == 1); assert (minSubArraySum({-1, -2, -3}) == -6); assert (minSubArraySum({-1, -2, -3, 2, -10}) == -14); assert (minSubArraySum({-9999999999999999}) == -9999999999999999); assert (minSubArraySum({0, 10, 20, 1000...
humaneval-x-cpp_data_CPP_115
#undef NDEBUG #include<assert.h> int main(){ assert (max_fill({{0,0,1,0}, {0,1,0,0}, {1,1,1,1}}, 1) == 6); assert (max_fill({{0,0,1,1}, {0,0,0,0}, {1,1,1,1}, {0,1,1,1}}, 2) == 5); assert (max_fill({{0,0,0}, {0,0,0}}, 5) == 0); assert (max_fill({{1,1,1,1}, {1,1,1,1}}, 2) == 4); assert (max_fill({{1,1...
humaneval-x-cpp_data_CPP_116
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(sort_array({1,5,2,3,4}) , {1, 2, 4, 3, 5})); assert (issame(sort_array(...
humaneval-x-cpp_data_CPP_117
#undef NDEBUG #include<assert.h> bool issame(vector<string> a,vector<string>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(select_words("Mary had a little lamb", 4) , {"little"} )); asse...
humaneval-x-cpp_data_CPP_118
#undef NDEBUG #include<assert.h> int main(){ assert (get_closest_vowel("yogurt") == "u"); assert (get_closest_vowel("full") == "u"); assert (get_closest_vowel("easy") == ""); assert (get_closest_vowel("eAsy") == ""); assert (get_closest_vowel("ali") == ""); assert (get_closest_vowel("bad") == "a...
humaneval-x-cpp_data_CPP_119
#undef NDEBUG #include<assert.h> int main(){ assert (match_parens({"()(", ")"}) == "Yes"); assert (match_parens({")", ")"}) == "No"); assert (match_parens({"(()(())", "())())"}) == "No"); assert (match_parens({")())", "(()()("}) == "Yes"); assert (match_parens({"(())))", "(()())(("}) == "Yes"); ...
humaneval-x-cpp_data_CPP_120
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(maximum({-3, -4, 5}, 3) , {-4, -3, 5})); assert (issame(maximum({4, -4,...
humaneval-x-cpp_data_CPP_121
#undef NDEBUG #include<assert.h> int main(){ assert (solutions({5, 8, 7, 1}) == 12); assert (solutions({3, 3, 3, 3, 3}) == 9); assert (solutions({30, 13, 24, 321}) == 0); assert (solutions({5, 9}) == 5); assert (solutions({2, 4, 8}) == 0); assert (solutions({30, 13, 23, 32}) == 23); asser...
humaneval-x-cpp_data_CPP_122
#undef NDEBUG #include<assert.h> int main(){ assert (add_elements({1,-2,-3,41,57,76,87,88,99}, 3) == -4); assert (add_elements({111,121,3,4000,5,6}, 2) == 0); assert (add_elements({11,21,3,90,5,6,7,8,9}, 4) == 125); assert (add_elements({111,21,3,4000,5,6,7,8,9}, 4) == 24); assert (add_elements({1},...
humaneval-x-cpp_data_CPP_123
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(get_odd_collatz(14) , {1, 5, 7, 11, 13, 17})); assert (issame(get_odd_c...
humaneval-x-cpp_data_CPP_124
#undef NDEBUG #include<assert.h> int main(){ assert (valid_date("03-11-2000") == true); assert (valid_date("15-01-2012") == false); assert (valid_date("04-0-2040") == false); assert (valid_date("06-04-2020") == true); assert (valid_date("01-01-2007") == true); assert (valid_date("03-32-2011") ==...
humaneval-x-cpp_data_CPP_125
#undef NDEBUG #include<assert.h> bool issame(vector<string> a,vector<string>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(split_words("Hello world!") , {"Hello","world!"})); assert (issam...
humaneval-x-cpp_data_CPP_126
#undef NDEBUG #include<assert.h> int main(){ assert (is_sorted({5}) == true); assert (is_sorted({1, 2, 3, 4, 5}) == true); assert (is_sorted({1, 3, 2, 4, 5}) == false); assert (is_sorted({1, 2, 3, 4, 5, 6}) == true); assert (is_sorted({1, 2, 3, 4, 5, 6, 7}) == true); assert (is_sorted({1, 3, 2, ...
humaneval-x-cpp_data_CPP_127
#undef NDEBUG #include<assert.h> int main(){ assert (intersection({1, 2}, {2, 3}) == "NO"); assert (intersection({-1, 1}, {0, 4}) == "NO"); assert (intersection({-3, -1}, {-5, 5}) == "YES"); assert (intersection({-2, 2}, {-4, 0}) == "YES"); assert (intersection({-11, 2}, {-1, -1}) == "NO"); asse...
humaneval-x-cpp_data_CPP_128
#undef NDEBUG #include<assert.h> int main(){ assert (prod_signs({1, 2, 2, -4}) == -9); assert (prod_signs({0, 1}) == 0); assert (prod_signs({1, 1, 1, 2, 3, -1, 1}) == -10); assert (prod_signs({}) == -32768); assert (prod_signs({2, 4,1, 2, -1, -1, 9}) == 20); assert (prod_signs({-1, 1, -1, 1}) ==...
humaneval-x-cpp_data_CPP_129
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(minPath({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}, 3) , {1, 2, 1})); assert (is...
humaneval-x-cpp_data_CPP_130
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(tri(3) , {1, 3, 2, 8})); assert (issame(tri(4) , {1, 3, 2, 8, 3})); ...
humaneval-x-cpp_data_CPP_131
#undef NDEBUG #include<assert.h> int main(){ assert (digits(5) == 5); assert (digits(54) == 5); assert (digits(120) ==1); assert (digits(5014) == 5); assert (digits(98765) == 315); assert (digits(5576543) == 2625); assert (digits(2468) == 0); } /* Given a positive integer n, return the pro...
humaneval-x-cpp_data_CPP_132
#undef NDEBUG #include<assert.h> int main(){ assert (is_nested("[[]]") == true); assert (is_nested("[]]]]]]][[[[[]") == false); assert (is_nested("[][]") == false); assert (is_nested(("[]")) == false); assert (is_nested("[[[[]]]]") == true); assert (is_nested("[]]]]]]]]]]") == false); assert...
humaneval-x-cpp_data_CPP_133
#undef NDEBUG #include<assert.h> int main(){ assert (sum_squares({1,2,3})==14); assert (sum_squares({1.0,2,3})==14); assert (sum_squares({1,3,5,7})==84); assert (sum_squares({1.4,4.2,0})==29); assert (sum_squares({-2.4,1,1})==6); assert (sum_squares({100,1,15,2})==10230); assert (sum_squares...
humaneval-x-cpp_data_CPP_134
#undef NDEBUG #include<assert.h> int main(){ assert (check_if_last_char_is_a_letter("apple") == false); assert (check_if_last_char_is_a_letter("apple pi e") == true); assert (check_if_last_char_is_a_letter("eeeee") == false); assert (check_if_last_char_is_a_letter("A") == true); assert (check_if_las...
humaneval-x-cpp_data_CPP_135
#undef NDEBUG #include<assert.h> int main(){ assert (can_arrange({1,2,4,3,5})==3); assert (can_arrange({1,2,4,5})==-1); assert (can_arrange({1,4,2,5,6,7,8,9,10})==2); assert (can_arrange({4,8,5,7,3})==4); assert (can_arrange({})==-1); } /* Create a function which returns the largest index of an el...
humaneval-x-cpp_data_CPP_136
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(largest_smallest_integers({2, 4, 1, 3, 5, 7}) , {0, 1})); assert (issam...
humaneval-x-cpp_data_CPP_137
#undef NDEBUG #include<assert.h> int main(){ assert (boost::any_cast<int>(compare_one(1, 2)) == 2); assert (boost::any_cast<double>(compare_one(1, 2.5))== 2.5); assert (boost::any_cast<int>(compare_one(2, 3)) == 3); assert (boost::any_cast<int>(compare_one(5, 6)) == 6); assert (boost::any_cast<strin...
humaneval-x-cpp_data_CPP_138
#undef NDEBUG #include<assert.h> int main(){ assert (is_equal_to_sum_even(4) == false); assert (is_equal_to_sum_even(6) == false); assert (is_equal_to_sum_even(8) == true); assert (is_equal_to_sum_even(10) == true); assert (is_equal_to_sum_even(11) == false); assert (is_equal_to_sum_even(12) == ...
humaneval-x-cpp_data_CPP_139
#undef NDEBUG #include<assert.h> int main(){ assert (special_factorial(4) == 288); assert (special_factorial(5) == 34560); assert (special_factorial(7) == 125411328000); assert (special_factorial(1) == 1); } /* The Brazilian factorial is defined as: brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... ...
humaneval-x-cpp_data_CPP_140
#undef NDEBUG #include<assert.h> int main(){ assert (fix_spaces("Example") == "Example"); assert (fix_spaces("Mudasir Hanif ") == "Mudasir_Hanif_"); assert (fix_spaces("Yellow Yellow Dirty Fellow") == "Yellow_Yellow__Dirty__Fellow"); assert (fix_spaces("Exa mple") == "Exa-mple"); assert (fix_spa...
humaneval-x-cpp_data_CPP_141
#undef NDEBUG #include<assert.h> int main(){ assert (file_name_check("example.txt") == "Yes"); assert (file_name_check("1example.dll") == "No"); assert (file_name_check("s1sdf3.asd") == "No"); assert (file_name_check("K.dll") == "Yes"); assert (file_name_check("MY16FILE3.exe") == "Yes"); assert ...
humaneval-x-cpp_data_CPP_142
#undef NDEBUG #include<assert.h> int main(){ assert (sum_squares({1,2,3}) == 6); assert (sum_squares({1,4,9}) == 14); assert (sum_squares({}) == 0); assert (sum_squares({1,1,1,1,1,1,1,1,1}) == 9); assert (sum_squares({-1,-1,-1,-1,-1,-1,-1,-1,-1}) == -3); assert (sum_squares({0}) == 0); asser...
humaneval-x-cpp_data_CPP_143
#undef NDEBUG #include<assert.h> int main(){ assert (words_in_sentence("This is a test") == "is"); assert (words_in_sentence("lets go for swimming") == "go for"); assert (words_in_sentence("there is no place available here") == "there is no place"); assert (words_in_sentence("Hi I am Hussein") == "Hi am...
humaneval-x-cpp_data_CPP_144
#undef NDEBUG #include<assert.h> int main(){ assert (simplify("1/5", "5/1") == true); assert (simplify("1/6", "2/1") == false); assert (simplify("5/1", "3/1") == true); assert (simplify("7/10", "10/2") == false); assert (simplify("2/10", "50/10") == true); assert (simplify("7/2", "4/2") == true)...
humaneval-x-cpp_data_CPP_145
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(order_by_points({1, 11, -1, -11, -12}) , {-1, -11, 1, -12, 11})); asser...
humaneval-x-cpp_data_CPP_146
#undef NDEBUG #include<assert.h> int main(){ assert (specialFilter({5, -2, 1, -5}) == 0 ); assert (specialFilter({15, -73, 14, -15}) == 1); assert (specialFilter({33, -2, -3, 45, 21, 109}) == 2); assert (specialFilter({43, -12, 93, 125, 121, 109}) == 4); assert (specialFilter({71, -2, -33, 75, 21, ...
humaneval-x-cpp_data_CPP_147
#undef NDEBUG #include<assert.h> int main(){ assert (get_matrix_triples(5) == 1); assert (get_matrix_triples(6) == 4); assert (get_matrix_triples(10) == 36); assert (get_matrix_triples(100) == 53361); } /* You are given a positive integer n. You have to create an integer vector a of length n. For ...
humaneval-x-cpp_data_CPP_148
#undef NDEBUG #include<assert.h> bool issame(vector<string> a,vector<string>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(bf("Jupiter", "Neptune") , {"Saturn", "Uranus"})); assert (issame...
humaneval-x-cpp_data_CPP_149
#undef NDEBUG #include<assert.h> bool issame(vector<string> a,vector<string>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(sorted_list_sum({"aa", "a", "aaa"}) , {"aa"})); assert (issame(so...
humaneval-x-cpp_data_CPP_150
#undef NDEBUG #include<assert.h> int main(){ assert (x_or_y(7, 34, 12) == 34); assert (x_or_y(15, 8, 5) == 5); assert (x_or_y(3, 33, 5212) == 33); assert (x_or_y(1259, 3, 52) == 3); assert (x_or_y(7919, -1, 12) == -1); assert (x_or_y(3609, 1245, 583) == 583); assert (x_or_y(91, 56, 129) == 1...
humaneval-x-cpp_data_CPP_151
#undef NDEBUG #include<assert.h> int main(){ assert (double_the_difference({}) == 0); assert (double_the_difference({5, 4}) == 25); assert (double_the_difference({0.1, 0.2, 0.3}) == 0 ); assert (double_the_difference({-10, -20, -30}) == 0 ); assert (double_the_difference({-1, -2, 8}) == 0); asse...
humaneval-x-cpp_data_CPP_152
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(compare({1,2,3,4,5,1},{1,2,3,4,2,-2}),{0,0,0,0,3,3})); assert (issame(c...
humaneval-x-cpp_data_CPP_153
#undef NDEBUG #include<assert.h> int main(){ assert (Strongest_Extension("Watashi", {"tEN", "niNE", "eIGHt8OKe"}) == "Watashi.eIGHt8OKe"); assert (Strongest_Extension("Boku123", {"nani", "NazeDa", "YEs.WeCaNe", "32145tggg"}) == "Boku123.YEs.WeCaNe"); assert (Strongest_Extension("__YESIMHERE", {"t", "eMptY",...
humaneval-x-cpp_data_CPP_154
#undef NDEBUG #include<assert.h> int main(){ assert (cycpattern_check("xyzw","xyw") == false ); assert (cycpattern_check("yello","ell") == true ); assert (cycpattern_check("whattup","ptut") == false ); assert (cycpattern_check("efef","fee") == true ); assert (cycpattern_check("abab","aabb") == ...
humaneval-x-cpp_data_CPP_155
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(even_odd_count(7) , {0, 1})); assert (issame(even_odd_count(-78) , {1, ...
humaneval-x-cpp_data_CPP_156
#undef NDEBUG #include<assert.h> int main(){ assert (int_to_mini_romank(19) == "xix"); assert (int_to_mini_romank(152) == "clii"); assert (int_to_mini_romank(251) == "ccli"); assert (int_to_mini_romank(426) == "cdxxvi"); assert (int_to_mini_romank(500) == "d"); assert (int_to_mini_romank(1) == "...
humaneval-x-cpp_data_CPP_157
#undef NDEBUG #include<assert.h> int main(){ assert (right_angle_triangle(3, 4, 5) == true); assert (right_angle_triangle(1, 2, 3) == false); assert (right_angle_triangle(10, 6, 8) == true); assert (right_angle_triangle(2, 2, 2) == false); assert (right_angle_triangle(7, 24, 25) == true); assert...
humaneval-x-cpp_data_CPP_158
#undef NDEBUG #include<assert.h> int main(){ assert ((find_max({"name", "of", "string"}) == "string")); assert ((find_max({"name", "enam", "game"}) == "enam")); assert ((find_max({"aaaaaaa", "bb", "cc"}) == "aaaaaaa")); assert ((find_max({"abc", "cba"}) == "abc")); assert ((find_max({"play", "this",...
humaneval-x-cpp_data_CPP_159
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(eat(5, 6, 10) , {11, 4})); assert (issame(eat(4, 8, 9) , {12, 1})); ...
humaneval-x-cpp_data_CPP_160
#undef NDEBUG #include<assert.h> int main(){ assert (do_algebra({"**", "*", "+"}, {2, 3, 4, 5}) == 37); assert (do_algebra({"+", "*", "-"}, {2, 3, 4, 5}) == 9); assert (do_algebra({"//", "*"}, {7, 3, 4}) == 8); } /* Given two vectors operator, and operand. The first vector has basic algebra operations, an...
humaneval-x-cpp_data_CPP_161
#undef NDEBUG #include<assert.h> int main(){ assert (solve("AsDf") == "aSdF"); assert (solve("1234") == "4321"); assert (solve("ab") == "AB"); assert (solve("#a@C") == "#A@c"); assert (solve("#AsdfW^45") == "#aSDFw^45"); assert (solve("#6@2") == "2@6#"); assert (solve("#$a^D") == "#$A^d"); ...
humaneval-x-cpp_data_CPP_162
#undef NDEBUG #include<assert.h> int main(){ assert (string_to_md5("Hello world") == "3e25960a79dbc69b674cd4ec67a72c62"); assert (string_to_md5("") == "None"); assert (string_to_md5("A B C") == "0ef78513b0cb8cef12743f5aeb35f888"); assert (string_to_md5("password") == "5f4dcc3b5aa765d61d8327deb882cf99");...
humaneval-x-cpp_data_CPP_163
#undef NDEBUG #include<assert.h> bool issame(vector<int> a,vector<int>b){ if (a.size()!=b.size()) return false; for (int i=0;i<a.size();i++) { if (a[i]!=b[i]) return false; } return true; } int main(){ assert (issame(generate_integers(2, 10) , {2, 4, 6, 8})); assert (issame(generate_inte...