為什么取余要用兩個(gè)%?
#include <stdio.h>
int main()
{
? ? int x = 0;
? ? printf("x=%d\n",++x);
? ? printf("x=%d\n",x++);
? ? return 0;
}
#include <stdio.h>
int main()
{
? ? int x = 0;
? ? printf("x=%d\n",++x);
? ? printf("x=%d\n",x++);
? ? return 0;
}
2018-10-15
舉報(bào)
2018-10-28
我給你說個(gè)簡單的:在printf中,%表示格式化符,后面會(huì)接具體的d,f, c, s等,
當(dāng)要輸出%這個(gè)字符時(shí),用%%來代替,
所以%%d會(huì)輸出%d,想要輸出帶%這個(gè)符號(hào)就要加2個(gè)%%,這樣說你明白吧!
2018-10-18
字符串和關(guān)鍵詞的不同
2018-10-17
第一個(gè)x++后在第二個(gè)++x中,第二個(gè)x是不是已經(jīng)是第一個(gè)x的值???
2018-10-15
有一個(gè)只是字符 就相當(dāng)于%d 比如 x%(%d)