#include<cstdio>//头文件
using namespace std;
int main()
{
//freopen("hi.in","r",stdin);
//freopen("hi.out","w",stdout);
int a;//%d
long b;//%ld
long long cb;//%lld
float s;//%f
double fs;//%lf
long double ffs;//%llf
char l[1000];//%s 不包含string
char t;//%c
// scanf("%d",&a);
// printf("%d %d",a,a);//输出a空格,再输出a
scanf("%lf%s",&fs,&l);
printf("%lf hello! %s",fs,l);//输出时可以加一些东东*/
//scanf("%s",&l);
//printf("%s\nThe end! ",l);// "\n"能代表换行,printf可以直接输出
fclose(stdin);
fclose(stdout);
return 0;
}
scanf输入输出
这段代码展示了C++中使用<stdio>库进行基本输入输出的操作,包括声明不同类型的变量如int,long,longlong,float,double等,并用scanf和printf函数读写数据。还涉及到文件重定向和fclose函数的使用。






