代碼是按書本練習的,%d 為什麼不能正確輸出呢
#include<stdio.h>
int main(void)
{
int feet, fathoms;
fathoms = 2;
feet = 6 * fathoms;
printf("There are %d feet in %d fathoms !");
return 0;
}
編譯如下
There are 2822964 feet in 2822964 fathoms !
代碼是按書本練習的,%d 為什麼不能正確輸出呢
#include<stdio.h>
int main(void)
{
int feet, fathoms;
fathoms = 2;
feet = 6 * fathoms;
printf("There are %d feet in %d fathoms !");
return 0;
}
編譯如下
There are 2822964 feet in 2822964 fathoms !
格式字符串中每一个%d要在后面加一个所对应的参数(feet和fathoms)。
【格式字符串中每一個%d要在後面加一個所對應的參數(feet和fathoms)。】