cp-documentation

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub zawa-tin/cp-documentation

:heavy_check_mark: YesかNoを出力する
(Src/Template/YesNo.hpp)

概要

真理値を受け取り、その真偽によって予め設定した文字列を出力します。

ライブラリの使い方

YesNo

void YesNo(bool answer)

answertrueならyesに設定された文字列を、falseならnoに設定された文字列を出力します。


SetYes

void SetYes(const std::string& yes)

yesの文字列を設定します。


SetNo

void SetNo(const std::string& no)

noの文字列を設定します。


SetAtCoderYesNo

void SetAtCoderYesNo()

yesYesに、noNoに設定します。


SetCodeforcesYesNo

void SetCodeforcesYesNo()

yesYESに、noNOに設定します。

Verified with

Code

#pragma once

#include <string>
#include <iostream>

namespace zawa {

namespace internal {

std::string yes{"Yes"};
std::string no{"No"};

} // namespace internal

void YesNo(bool answer) {
    std::cout << (answer ? internal::yes : internal::no) << std::endl;
}

void SetYes(const std::string& yes) {
    internal::yes = yes;
}

void SetNo(const std::string& no) {
    internal::no = no;
}

void SetAtCoderYesNo() {
    SetYes("Yes");
    SetNo("No");
}

void SetCodeforcesYesNo() {
    SetYes("YES");
    SetNo("NO");
}

} // namespace zawa
#line 2 "Src/Template/YesNo.hpp"

#include <string>
#include <iostream>

namespace zawa {

namespace internal {

std::string yes{"Yes"};
std::string no{"No"};

} // namespace internal

void YesNo(bool answer) {
    std::cout << (answer ? internal::yes : internal::no) << std::endl;
}

void SetYes(const std::string& yes) {
    internal::yes = yes;
}

void SetNo(const std::string& no) {
    internal::no = no;
}

void SetAtCoderYesNo() {
    SetYes("Yes");
    SetNo("No");
}

void SetCodeforcesYesNo() {
    SetYes("YES");
    SetNo("NO");
}

} // namespace zawa
Back to top page