結果

問題 No.304 鍵(1)
ユーザー ldsybldsyb
提出日時 2016-02-25 14:28:56
言語 C++11
(gcc 11.4.0)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 197 bytes
コンパイル時間 260 ms
コンパイル使用メモリ 50,664 KB
最終ジャッジ日時 2024-04-27 02:17:44
合計ジャッジ時間 554 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:23: error: no match for ‘operator==’ (operand types are ‘std::basic_istream<char>’ and ‘const char [9]’)
    9 |       if(cin >> input == "unlocled") break;
      |          ~~~~~~~~~~~~ ^~ ~~~~~~~~~~
      |              |           |
      |              |           const char [9]
      |              std::basic_istream<char>
In file included from /usr/include/c++/11/iosfwd:40,
                 from /usr/include/c++/11/ios:38,
                 from /usr/include/c++/11/ostream:38,
                 from /usr/include/c++/11/iostream:39,
                 from main.cpp:1:
/usr/include/c++/11/bits/postypes.h:222:5: note: candidate: ‘template<class _StateT> bool std::operator==(const std::fpos<_StateT>&, const std::fpos<_StateT>&)’
  222 |     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/11/bits/postypes.h:222:5: note:   template argument deduction/substitution failed:
main.cpp:9:26: note:   ‘std::basic_istream<char>’ is not derived from ‘const std::fpos<_StateT>’
    9 |       if(cin >> input == "unlocled") break;
      |                          ^~~~~~~~~~
In file included from /usr/include/c++/11/bits/stl_algobase.h:64,
                 from /usr/include/c++/11/bits/char_traits.h:39,
                 from /usr/include/c++/11/ios:40,
                 from /usr/include/c++/11/ostream:38,
                 from /usr/include/c++/11/iostream:39,
                 from main.cpp:1:
/usr/include/c++/11/bits/stl_pair.h:466:5: note: candidate: ‘template<class _T1, class _T2> constexpr bool std::operator==(const std::pair<_T1, _T2>&, const std::pair<_T1, _T2>&)’
  466 |     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/11/bits/stl_pair.h:466:5: note:   template argument deduction/substitution failed:
main.cpp:9:26: note:   ‘std::basic_istream<char>’ is not derived from ‘const std::p

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;

int main(){
   string input;
   for(int i = 0;i < 1000;i++){
      cout << i << endl;
      if(cin >> input == "unlocled") break;
   }
}
0