Data update
This commit is contained in:
parent
35bcdeebf8
commit
74c69a0df6
2427 changed files with 31826 additions and 3468 deletions
25
Task/Quoting-constructs/C++/quoting-constructs.cpp
Normal file
25
Task/Quoting-constructs/C++/quoting-constructs.cpp
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
int main() {
|
||||
// C++ uses double quotes for strings and single quotes for characters.
|
||||
std::string simple_string = "This is a simple string";
|
||||
char letter = 'A';
|
||||
std::cout << simple_string << " " << letter << std::endl;
|
||||
|
||||
// C++ can implement multiline strings.
|
||||
std::string multiline_string = R"(
|
||||
An example of multi-line string.
|
||||
Text formatting is preserved.
|
||||
This is a raw string literal, introduced in C++ 11.)";
|
||||
std::cout << multiline_string << std::endl;
|
||||
|
||||
// C++'s primitive data types: bool, char, double, float, int, long, short,
|
||||
// can be used to to store data, for example,
|
||||
const int block_length = 64;
|
||||
std::cout << "block length = " << block_length << std::endl;
|
||||
|
||||
// Vectors of these data types are also possible, for example,
|
||||
std::vector<double> state = { 1.0, 2.0, 3.0 };
|
||||
}
|
||||
|
|
@ -11,11 +11,11 @@ public final class QuotingConstructs {
|
|||
String multiLineString = """
|
||||
This is an example of multi-line string.
|
||||
Text formatting is preserved.
|
||||
Text blocks can be used for multi-line string.
|
||||
Text blocks can be used for a multi-line string.
|
||||
""";
|
||||
System.out.println(multiLineString);
|
||||
|
||||
// Java's primitive data types: boolean, byte, char double, float, int, long, short,
|
||||
// Java's primitive data types: boolean, byte, char, double, float, int, long, short,
|
||||
// can be used to to store data, for example,
|
||||
final int blockLength = 64;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue