規律:printf函數中,當出現多個%時,由左至右,每兩個%結合輸出一個%
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{int c = 52;printf("% \n %% \n %%% \n %%%% \n %%%%% \n %%%%%%\n");printf("%d %%d %%%d %%%%d %%%%%d %%%%%%d\n",c,c,c,c,c,c);return 0;
}
結果
%%%%%%%%%
52 %d %52 %%d %%52 %%%d