結果

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

コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:11:23: error: no match for 'operator==' (operand types are 'std::basic_istream<char>' and 'const char [9]')
   11 |       if(cin >> input == "unlocked") break;
      |          ~~~~~~~~~~~~ ^~ ~~~~~~~~~~
      |              |           |
      |              |           const char [9]
      |              std::basic_istream<char>
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/iosfwd:40,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ios:38,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:38,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/iostream:39,
                 from main.cpp:1:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/postypes.h:192:5: note: candidate: 'template<class _StateT> bool std::operator==(const fpos<_StateT>&, const fpos<_StateT>&)'
  192 |     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
      |     ^~~~~~~~
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/postypes.h:192:5: note:   template argument deduction/substitution failed:
main.cpp:11:26: note:   'std::basic_istream<char>' is not derived from 'const std::fpos<_StateT>'
   11 |       if(cin >> input == "unlocked") break;
      |                          ^~~~~~~~~~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/string:41,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/locale_classes.h:40,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/ios_base.h:41,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ios:42:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/allocator.h:219:5: note: candidate: 'template<class _T1, class _T2> bool std::operator==(const alloc

ソースコード

diff #

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

int main(){
   string input;
   for(int i = 0;i < 1000;i++){
      if(10 <= i && i < 100) cout << "0";
      else if(i < 10) cout << "00";
      cout << i << endl;
      if(cin >> input == "unlocked") break;
   }
}
0