素数を知りたいか?
yes : 1, no : 0
#include<iostream>
int main(void) {
auto Prime = [](int value) {for (int i = 2; i < value; i++) if (value % i == 0) return false; return true; };
int hoge;
std::cin >> hoge;
std::cout << Prime(hoge);
}
Go to list of users who liked
素数を知りたいか?
yes : 1, no : 0
#include<iostream>
int main(void) {
auto Prime = [](int value) {for (int i = 2; i < value; i++) if (value % i == 0) return false; return true; };
int hoge;
std::cin >> hoge;
std::cout << Prime(hoge);
}
Register as a new user and use Qiita more conveniently
Go to list of users who liked