标签:flag adjust image namespace 技术 span 分享图片 space uppercase
11-3
#include<iostream> #include<fstream> using namespace std; int main() { ofstream file("test1.txt"); file<< "已成功写入文件!"; file.close(); return 0; }
11-4
#include<fstream> #include<iostream> using namespace std; int main(){ char ch; ifstream file1("test.txt"); while(file1.get(ch)) cout<<ch; file1.close(); }
11-7
#include <iostream> using namespace ::std; int main() { ios_base::fmtflags original_flags = cout.flags(); cout<< 812<<‘|‘; cout.setf(ios_base::left,ios_base::adjustfield); cout.width(10); cout<<813<<815<<‘\n‘; cout.unsetf(ios_base::adjustfield); cout.precision(2); cout.setf(ios_base::uppercase|ios_base::scientific); cout << 831.0 ; cout.flags(original_flags); }
标签:flag adjust image namespace 技术 span 分享图片 space uppercase
原文地址:https://www.cnblogs.com/baiyixin/p/9206744.html