每天一得,能得就得~~^_^
关于printf()的坑点:
#include <stdio.h> int main() { int num = 10; printf("用printf打印时,占位符用%%f来获取int数10,会得到:%f ", num); float fl = 10.96; printf("\n用printf打印时,占位符用%%d来获取float数10.9,会得到:%d ", fl); getchar(); }
运行结果:
关于printf()的坑点:
#include <stdio.h> int main() { int num = 10; printf("用printf打印时,占位符用%%f来获取int数10,会得到:%f ", num); float fl = 10.96; printf("\n用printf打印时,占位符用%%d来获取float数10.9,会得到:%d ", fl); getchar(); }
运行结果: