| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 62381 | 刘宇轩 | 字符串相等判断 | C++ | Compile Error | 0 MS | 0 KB | 206 | 2023-12-23 16:34:51 |
#include<iostream> # include<cstring> using namespace std; int main(){ char a,b; cin>>a>>b; int c; c=strcmp(a,b); if(c==0){ cout<<"yes"; } else{ cout<<"no"; } return 0; }
Main.cc: In function 'int main()':
Main.cc:8:14: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
c=strcmp(a,b);
^
In file included from /usr/include/c++/5/cstring:42:0,
from Main.cc:2:
/usr/include/string.h:140:12: note: initializing argument 1 of 'int strcmp(const char*, const char*)'
extern int strcmp (const char *__s1, const char *__s2)
^
Main.cc:8:14: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
c=strcmp(a,b);
^
In file included from /usr/include/c++/5/cstring:42:0,
from Main.cc:2:
/usr/include/string.h:140:12: note: initializing argument 2 of 'int strcmp(const char*, const char*)'
extern int strcmp (const char *__s1, const char *__s2)
^