注:本题解只提供C/C++题解(C讲解)
题目链接
C/C++中有一个封装函数 printf()
,作用是输出其中的内容。
printf()
输出字符串格式为:
printf(字符串);
printf(字符串);
printf()
调用头文件:
#include <cstdio>
#include <stdio.h>
字符串通常用""
括起,例如:
"printf()"
"printf()"
所以代码就是
#include <cstdio>
using namespace std;
int main() {
printf("hello nowcoder");
return 0;
}
#include <stdio.h>
int main() {
printf("hello nowcoder");
return 0;
}