您的位置:首页 > 其它

fprintf与fscanf

2015-11-13 13:41 120 查看
#include <stdio.h>

int main()
{
//printf("Please input the value a:\n");  等于下一句
fprintf(stdout, "Please input the value a:\n");
int a;
//scanf("%d",&a);  等于下一句
fscanf(stdin,"%d",&a);
if(a<0){
fprintf(stderr, "The value must > 0\n");
return 1;
}else{
fprintf(stdout, "The value a is %d\n",a);
}

return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: