今天在知乎里看到这个话题。瞬间秒杀呀,还没有考虑过这个问题。
#include <stdio.h>
int main(int argc, char *argv[])
{
int a=123456;
printf("%d",a);//123456printf("\n");
printf("%d",printf("%d",a));//1234566 printf("\n");
printf("%d",printf("%d",printf("%d",a));//12345661 printf("\n");
return 0;}
function
printf
int printf ( const char * format, ... );
Print formatted data to stdout
Writes to the standard output (stdout) a sequence of data formatted as the
format argument specifies. After the
format parameter, the function expects at least as many additional arguments as specified in
format.
Return Value
On success, the total number of characters written is returned.
On failure, a negative number is returned.
也即:printf返回的是打印字符的总个数。。