Created
February 24, 2025 15:40
-
-
Save Artin0123/5ad264a4c37ab37c1faff20fc55a40c8 to your computer and use it in GitHub Desktop.
查詢cpp版本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| int main() { | |
| if (__cplusplus == 202002L) | |
| std::cout << "C++20\n"; | |
| else if (__cplusplus == 201703L) | |
| std::cout << "C++17\n"; | |
| else if (__cplusplus == 201402L) | |
| std::cout << "C++14\n"; | |
| else if (__cplusplus == 201103L) | |
| std::cout << "C++11\n"; | |
| else if (__cplusplus == 199711L) | |
| std::cout << "C++98\n"; | |
| else | |
| std::cout << "pre-standard C++\n"; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment