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