Category : boolean

My goal is that: the program return the list of numbers in the vector i made, which are the primes numbers, the code is wrong, #include <iostream> #include <vector> #include <math.h> using namespace std; vector < int > L; bool mark[10]; void colador() { fill(mark,mark+10, false); for(int i=2; i*i <=10; i++) { if(!mark[i]) { L.push_back(i); ..

Read more

#include <bits/stdc++.h> #define out(x) std::cout << x << std::endl bool isnotempty(const std::string &str) { return !str.empty(); } int main() { std::string unary[] = {"s", "c", "t", "co", "se", "cot", "ln", "e", "d", "i", "sq", "r"}; int num_of_unary = std::count_if(unary, &unary[50], isnotempty); std::string binary[] = {"+", "-", "/", "*", "$"}; int num_of_binary = std::count_if(binary, &binary[50], isnotempty); ..

Read more