📜  c++代码示例中的变量

📅  最后修改于: 2022-03-11 14:44:51.917000             🧑  作者: Mango

代码示例2
#include 
using namespace std;

int main() {
// To define variables in C++, you have to specify the data type. Example:
int number = 10; // Declares a variable with the integer data type.
float decimal = 3.5;  // Declares a variable with the float data type.
double decimalNum = 3.3333; // Doubles are used for more specific points in floats.
string text = "Hello World";  // Declares a variable with the string data type.
bool result = true;  // Declares a variable with the boolean data type.
  
}