ではありませんので、私は学校プロジェクトのC++プログラムで作業しています。Cシェル(cpp.sh、ブラウザベースのコンパイラ)がプログラムを実行しています。Visual Studioは
私は条件付き演算子の束を使用しました(私は省略形が好きです)、それはCシェルでうまく動作します(これはリンクです)... http://cpp.sh/7fsj)しかし、Visual Studio C++
#include <iostream>
using namespace std;
int main()
{
cout << "Please enter an angle and I will tell you which quadrant it is in.\n\n\n";
double angle;
cin >> angle;
cout << endl;
bool first, second, third, fourth, xaxis, yaxis, nxaxis, nyaxis;
if (angle < 0 || angle > 360)
cout << "Invalid input.";
else
{
(angle > 0 && angle < 90 ? first = true : first = false);
(first == true ? cout << "The angle you entered is in the first quadrant.\n\n" : cout << "");
(angle > 90 && angle < 180 ? second = true : second = false);
(second == true ? cout << "The angle you entered is in the second quadrant.\n\n" : cout << "");
(angle > 180 && angle < 270 ? third = true : third = false);
(third == true ? cout << "The angle you entered is in the third quadrant.\n\n" : cout << "");
(angle > 270 && angle < 360 ? fourth = true : fourth = false);
(fourth == true ? cout << "The angle you entered is in the fourth quadrant.\n\n" : cout << "");
(angle == 0 || angle == 360 ? nxaxis = true : nxaxis = false);
(angle == 180 ? xaxis = true : xaxis = false);
(nxaxis == true ? cout << "This angle lies on the negative portion of the x axis.\n\n" : "");
(xaxis == true ? cout << "This angle lies on the positive portion of the x axis.\n\n" : "");
(angle == 90 ? yaxis = true : yaxis = false);
(angle == 270 ? nyaxis = true : nyaxis = false);
(yaxis == true ? cout << "This angle lies on the positive portion of the y axis.\n\n" : "");
(nyaxis == true ? cout << "This angle lies on the negative portion of the y axis.\n\n" : "");
}
system("pause");
return 0;
}
がそれを実行しますが、VS
に、私は任意の論理を見つけることができないではない。私のコードで何らかのエラーがあった場合、私は私のプログラムがある
...興味がありましたエラーやエラーの理由はありますが、これはこのままです"1>------ Build started: Project: lab-projects, Configuration: Debug Win32 ------
1> project.cpp
1>c:\users\wishi\documents\visual studio 2010\projects\lab-projects\lab-projects\project.cpp(179): error C2446: ':' : no conversion from 'const char *' to 'std::basic_ostream<_Elem,_Traits>'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\wishi\documents\visual studio 2010\projects\lab-projects\lab-projects\project.cpp(180): error C2446: ':' : no conversion from 'const char *' to 'std::basic_ostream<_Elem,_Traits>'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\wishi\documents\visual studio 2010\projects\lab-projects\lab-projects\project.cpp(183): error C2446: ':' : no conversion from 'const char *' to 'std::basic_ostream<_Elem,_Traits>'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous
1>c:\users\wishi\documents\visual studio 2010\projects\lab-projects\lab-projects\project.cpp(184): error C2446: ':' : no conversion from 'const char *' to 'std::basic_ostream<_Elem,_Traits>'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> No constructor could take the source type, or constructor overload resolution was ambiguous
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped =========="
これは初心者向けプログラミングクラスなので、私はこれが何を意味するのか分かりません。 誰でも助けることができますか?