要求:在下面程序段基础上,继续写完代码,完成如图所示的输出:
#include <stdio.h> int main() { printf("Name\tAge\tSalary\taddr\n"); printf("Tom\t%d\t%6.1f\t%s\n", 20, 314.2, "NewYork"); //继续写下去 return 0; }
参考解答:
#include <stdio.h> int main() { printf("Name\tAge\tSalary\taddr\n"); printf("Tom\t%d\t%6.1f\t%s\n", 20, 314.2, "NewYork"); printf("Jerry\t%d\t%6.1f\t%s\n", 22, 7876.4, "Beijing"); printf("Blotu\t%d\t%6.1f\t%s\n", 9, 5.45, "Shanghai"); return 0; }