mirror of
https://github.com/krahets/hello-algo.git
synced 2025-11-03 13:43:06 +08:00
docs: add Japanese translate documents (#1812)
* docs: add Japanese documents (`ja/docs`) * docs: add Japanese documents (`ja/codes`) * docs: add Japanese documents * Remove pythontutor blocks in ja/ * Add an empty at the end of each markdown file. * Add the missing figures (use the English version temporarily). * Add index.md for Japanese version. * Add index.html for Japanese version. * Add missing index.assets * Fix backtracking_algorithm.md for Japanese version. * Add avatar_eltociear.jpg. Fix image links on the Japanese landing page. * Add the Japanese banner. --------- Co-authored-by: krahets <krahets@163.com>
This commit is contained in:
committed by
GitHub
parent
2487a27036
commit
954c45864b
29
ja/codes/cpp/chapter_hashing/built_in_hash.cpp
Normal file
29
ja/codes/cpp/chapter_hashing/built_in_hash.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* File: built_in_hash.cpp
|
||||
* Created Time: 2023-06-21
|
||||
* Author: krahets (krahets@163.com)
|
||||
*/
|
||||
|
||||
#include "../utils/common.hpp"
|
||||
|
||||
/* ドライバーコード */
|
||||
int main() {
|
||||
int num = 3;
|
||||
size_t hashNum = hash<int>()(num);
|
||||
cout << "The hash value of integer " << num << " is " << hashNum << "\n";
|
||||
|
||||
bool bol = true;
|
||||
size_t hashBol = hash<bool>()(bol);
|
||||
cout << "The hash value of boolean " << bol << " is " << hashBol << "\n";
|
||||
|
||||
double dec = 3.14159;
|
||||
size_t hashDec = hash<double>()(dec);
|
||||
cout << "The hash value of decimal " << dec << " is " << hashDec << "\n";
|
||||
|
||||
string str = "Hello algorithm";
|
||||
size_t hashStr = hash<string>()(str);
|
||||
cout << "The hash value of string " << str << " is " << hashStr << "\n";
|
||||
|
||||
// C++では、組み込みのstd:hash()は基本データ型のハッシュ値のみを提供
|
||||
// 配列やオブジェクトのハッシュ値計算は手動で実装する必要がある
|
||||
}
|
||||
Reference in New Issue
Block a user