看如下代码:

  #include <stdio.h>

  int main(int argc, const char *argv[])
{
printf("%s\n","peng","dopmg","石家庄铁道大学");
return ;
}

将代码改成:

 #include <stdio.h>

 int main(int argc, const char *argv[])
{
printf("%s%s%s\n","peng","dopmg","石家庄铁道大学");
return ;
}

结果变成:

格式化输出:

 #include <stdio.h>
#include <limits.h> int main(void)
{
unsigned char uc = UCHAR_MAX;
unsigned short us = USHRT_MAX;
unsigned int ui = UINT_MAX;
unsigned long ul = ULONG_MAX;
unsigned long long ull = ULLONG_MAX;
puts("[output, specific values are implementation-dependent.]"); printf("UCHAR_MAX, %u (decimal), %#o (octal), %#x (hex)\n",
uc, uc, uc); printf("USHRT_MAX, %u (decimal), %#o (octal), %#x (hex)\n",
us, us, us); printf("UINT_MAX, %u (decimal), %#o (octal),\n %#x (hex)\n",
ui, ui, ui); printf("ULONG_MAX, %lu (decimal), %#lo (octal),\n %#lx (hex)\n",
ul, ul, ul); printf
("ULLONG_MAX, %llu (decimal),\n %#llo (octal),\n %#llx (hex)\n",
ull, ull, ull); puts("[end of output]");
return ;
} [output, specific values are implementation-dependent.]
UCHAR_MAX, (decimal), (octal), 0xff (hex)
USHRT_MAX, (decimal), (octal), 0xffff (hex)
UINT_MAX, (decimal), (octal),
0xffffffff (hex)
ULONG_MAX, (decimal), (octal),
0xffffffff (hex)
ULLONG_MAX, (decimal),
(octal),
0xffffffffffffffff (hex)
[end of output]
05-11 16:12
查看更多