11.3
#include#include using namespace std;int main() { ofstream test("test1.txt"); test<< "已成功写入文件!"; test.close(); return 0;}
11.4
#include#include using namespace std;int main(){ char ch; ifstream test1("test.txt"); while(test1.get(ch)) cout<
11.7
#includeusing 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); }