TA的每日心情 | 汗 2024-10-15 10:05 |
---|
签到天数: 372 天 [LV.9]以坛为家II
|
代码:- #include <stdio.h>
- int main() {
-
- int a = 0;
- int b = 0;
- int c = 0;
-
- printf("Please input the first number:"); //提示语
- scanf("%d", &a); //调用系统函数“scanf()”,输入整数,通过取变量地址将接收值返回
-
- printf("Please input the second number:");
- scanf("%d", &b);
-
- c = a + b; //基本运算
- printf("The sum of %d+%d=%d\n", a, b, c); //输出最终结果
-
- }
复制代码 运行结果:- Please input the first number:46
- Please input the second number:54
- The sum of 46+54=100
复制代码
|
|