自考新教材-p291

源程序:

//程序7-10

#include <iostream>

using namespace std;

int main()

{

char c = 'a', str[80] = "0123456789abcdefghijklmn";

int x = 65;

cout << "cout.put('a'):";

cout.put('a');

cout << "\ncout.put(c+25):";

cout.put(c + 25);

cout << "\ncout.put(x):";

cout.put(x);

cout.write(str, 20);        //将str的前20个字节写入到输出流中

system("pause");

return 0;

}

运行结果:

posted @ 2020-01-27 14:45  bobo哥  阅读(127)  评论(0编辑  收藏  举报