正在加载图片...
int main( fstream outFile(numbers. txt", ios: out ) int nums33]={1234,3,567,34,8,6789,124,2345,89}; for( int row=0;row<3;row++)∥向文件输出三行 for(int col=0; col<3; col++) outFile < setw(10)<< numsrowllcol < out File < endl outFile. close(; return U; 2-5. cppint main( ) { fstream outFile("numbers.txt", ios::out ); int nums[3][3] = { 1234, 3, 567, 34, 8, 6789, 124, 2345, 89 } ; for( int row = 0 ; row < 3 ; row++ ) // 向文件输出三行 { for( int col = 0 ; col < 3 ; col++ ) outFile << setw(10) << nums[row][col] <<" " ; outFile << endl ; } outFile.close( ); return 0; } 2-5.cpp
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有