#include<stdio.h>
/*
*stdin标准输入流
stdout输出流
stderr错误流
*/
int main()
{
/* printf("hello world!");
int a;
scanf("%d",&a);
printf("input value is :%d",a);
*/
//
fprintf(stdout,"plese input the value a:\n");//等价于printf("plese input the value a:\n");
int a;
// scanf("%d",&a);等价下下面 默认从键盘获得,也可以修改参数,从打印机获得
fscanf(stdin,"%d",&a);
if(a<0){
fprintf(stderr,"the value must >0");
return 1;
}
fscanf(stdin,"%d",&a);
return 0;
}
`
输入输出流和错误流
最新推荐文章于 2023-03-15 15:07:24 发布