标签:cout namespace png name height names 程序 reserve com
源程序:
//
// main.cpp
// p286
//
// Created by duanqibo on 2020/1/27.
// Copyright © 2020年 duanqibo. All rights reserved.
//
//程序7-7
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
string s1,s2;
cin>>setw(5)>>s1>>setw(3)>>s2; //设置输入的字符串格式(长度)
cout<<"s1="<<s1<<", s2="<<s2<<endl;
return 0;
}
运行结果:
标签:cout namespace png name height names 程序 reserve com
原文地址:https://www.cnblogs.com/duanqibo/p/12235984.html