规律: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