我的问题是:
首先读取一个名为
symbols.txt
的文件。该文件包含许多行,每行由2个元素组成:一个大写字母和一个字符串,此文件以哈希(#
)结尾。第二读一个名为
结尾dict.txt
的文件。该文件包含许多单词(字符串)。以哈希(#
)第三读了一个名为
结尾handin.txt
的文件。该文件包含一些您将要处理的数字。以哈希(#
)将输出打印到名为
handout.txt
的文件中>这是我的代码,但是我不确定我是否正确读取输入内容。请帮我检查一下。非常感谢。
#include<bits/stdc++.h>
using namespace std;
int main() {
freopen("symbols.txt" , "r" , stdin);
// input the letter and the string
char X ; string Y ;
while(cin >> X >> Y && X != '#' ) {
// my code goes here
}
freopen("dict.txt" , "r" , stdin) ;
// input the strings here
freopen("handin.txt", "r" , stdin);
// input the numbers here
/ *
Here is my code
* /
freopen("handout.txt" , "w" , stdout);
// let in print the output here
}
我的问题是:首先读取一个名为symbols.txt的文件。该文件包含多行,每行包含2个元素:大写字母和字符串,该文件以hash(#)结尾。 ...
#include<bits/stdc++.h>