list1715.cpp
来自「teach yourself C++ in 21 days 第五版」· C++ 代码 · 共 28 行
CPP
28 行
//17.15 Printing with printf()
#include <stdio.h>
int main()
{
printf("%s","hello world\n");
char *phrase = "Hello again!\n";
printf("%s",phrase);
int x = 5;
printf("%d\n",x);
char *phraseTwo = "Here's some values: ";
char *phraseThree = " and also these: ";
int y = 7, z = 35;
long longVar = 98456;
float floatVar = 8.8f;
printf("%s %d %d",phraseTwo,y,z);
printf("%s %ld %f\n",phraseThree,longVar,floatVar);
char *phraseFour = "Formatted: ";
printf("%s %5d %10d %10.5f\n",phraseFour,y,z,floatVar);
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?