-1
代码的右手操作数:错误C2679:二进制 '<<':没有操作员发现这需要型“的std :: string”
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
ifstream fin ("ride.in.txt");
ofstream fout ("ride.out.txt");
int ta, tb;unsigned int i;
ta = tb = 1;
string a, b;
fin >> a >> b;
for (i = 0; i < a.size(); i++)
ta = ta * (a[i] - 'A' + 1) % 47;
for (i = 0; i < b.size(); i++)
tb = tb * (b[i] - 'A' + 1) % 47;
if (ta == tb)
fout << "GO" << endl;
else
fout << "STAY" << endl;
return 0;
}
错误:
error C2679:
binary '<<' : no operator found which takes a right-hand operand of type “std::string”
毫无疑问,代码编译(当删除未提供的预编译头部时)在叮当中。 – Andre 2011-12-30 12:49:06
它会在任何编译器上进行编译,这些编译器的库*发生*包括''或''中的''。一个C++标准头允许包含任何其他标准头。 –
2011-12-30 14:56:24