错误
#include<iostream>
#include<fstream>
using namespace std;
int main() {
cout << "ctiny(continuity)4" << endl;
ofstream sin("c:\\ctiny.txt");
string f;
f = "qgq/awww/were/terrible/that/yyyyy/uuuu/III in/Oooo/popped/AAA and/sass/adds/FFF/gagged/high/Jjjkkkk/KKK/Lilly/zzz/xxx/cCCC/Viva/Bobby/Nunn/Mmmmp";
sin>>f;
cout<<"The solution file has been saved to the C drive"<<endl;
string cti;
while (true){
cout << "input:";
cin>>cti;
if (cti == "qgq") {
cout << "q";
}
else if (cti == "awww") {
cout << "w";
}
else if (cti == "were") {
cout << "e";
}
else if (cti == "terrible") {
cout << "r";
}
else if (cti == "that") {
cout << "t";
}
else if (cti == "yyyyy") {
cout << "y";
}
else if (cti == "uuuu") {
cout << "u";
}
else if (cti == "III") {
cout << "i";
}
else if (cti == "Oooo") {
cout << "o";
}
else if (cti == "popped") {
cout << "p";
}
else if (cti == "AAA") {
cout << "a";
}
else if (cti == "sass") {
cout << "s";
}
else if (cti == "adds") {
cout << "d";
}
else if (cti == "FFF") {
cout << "f";
}
else if (cti == "gagged") {
cout << "g";
}
else if (cti == "high") {
cout << "h";
}
else if (cti == "Jjjkkkk") {
cout << "j";
}
else if (cti == "KKK") {
cout << "k";
}
else if (cti == "Lilly") {
cout << "y";
}
else if (cti == "zzz") {
cout << "z";
}
else if (cti == "xxx") {
cout << "x";
}
else if (cti == "cCCC") {
cout << "c";
}
else if (cti == "Viva") {
cout << "v";
}
else if (cti == "Bobby") {
cout << "b";
}
else if (cti == "Nunn") {
cout << "n";
}
else if (cti == "Mmmmp") {
cout << "m";
}
else {
cout << "not";
}
cout<<"\ncontinue/break:";
string cb;
cin>>cb;
if (cb=="continue"){
continue;
}
if(cb=="break"){
break;
}
}
}
运行结果:9 5 D:\c++cpp\Ctiny.cpp [Error] no match for 'operator>>' (operand types are 'std::ofstream {aka std::basic_ofstream}' and 'std::string {aka std::basic_string}')