#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int main()
{
int num1 = 0;
int num2 = 0;
scanf("%d%d",&num1,&num2);
int sum = num1 + num2;
printf("sum = %d + %d = %d\n",num1,num2,sum);
system("pause");
return 0;
}
在代碼中,stdio.h是一個輸入輸出的頭文件,只要代碼中出現printf()和scanf()函數,就要加上這個頭文件。
頭文件stdlib.h在此代碼中所引用的功能只用system("pause");,
輸入這個代碼的功能演示:ide