一个很简单的问题,打开文件夹的问题
文件夹名:infile.you 文件夹内容:1
2
3
4
程序代码:
#include <fstream> #include<iostream> int main( ) { using namespace std; ifstream in_stream; ofstream out_stream; in_stream.open("infile.you"); out_stream.open("outfile.you"); int first, second, third; in_stream >> first >> second >> third; out_stream << "The sum of the first 3\n" << "numbers in infile.you\n" << "is " << (first + second + third) << endl; in_stream.close( ); out_stream.close( ); system("pause"); return 0; }然后译出来的结果应该是6,为什么我译出来的是一堆数字????
谢谢