请定义四个整型变量并打印输出这四个整型变量
时间: 2023-05-29 21:06:54 浏览: 54
我是AI语言模型,以下是Python的代码示例:
```python
# 定义四个整型变量
a = 1
b = 2
c = 3
d = 4
# 打印输出这四个整型变量
print(a, b, c, d)
```
输出结果为:
```
1 2 3 4
```
相关问题
请定义四个整型变量并打印输出这四个变量加减乘除后的结果
以下是Python语言的代码示例:
```python
a = 10
b = 5
c = 2
d = 8
print("a + b =", a + b)
print("c - d =", c - d)
print("b * c =", b * c)
print("d / a =", d / a)
```
输出结果为:
```
a + b = 15
c - d = -6
b * c = 10
d / a = 0.8
```
请定义四个整型变量并打印出这四个变量加减乘除后的结果
int a = 10;
int b = 5;
int c = 2;
int d = 3;
printf("a + b = %d\n", a + b);
printf("a - c = %d\n", a - c);
printf("b * d = %d\n", b * d);
printf("a / c = %d\n", a / c); // 注意:两个整型相除结果也是整型,会自动向下取整
阅读全文