首页 > 其他 > 详细

自考新教材-p279_1

时间:2020-01-27 12:38:17      阅读:83      评论:0      收藏:0      [点我收藏+]

源程序:

#include <iostream>

using namespace std;

int main()

{

int x, y;

cin >> x >> y;

freopen("c:\\test.txt", "w", stdout); 

if (y == 0)                            

cerr<<"error."<<endl;

else

cout << x << "/" << y << "=" << x / y << endl;

system("pause");

return 0;

}

 运行结果:

输入:9 3

在c盘上产生文本文件test.txt,内容为:9/3=3

自考新教材-p279_1

原文:https://www.cnblogs.com/duanqibo/p/12235657.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!