Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
73144 梁敖铭 字符的前导值和后继值 C++ Compile Error 0 MS 0 KB 220 2024-05-18 09:44:37

Tests(0/0):


Code:

#include<iostream> using namespace std; int main(){ char a; int b,c; cin>>a; b=a-1; c=a+1; if(b<32){ "Input Error!"=b; } if(c>126){ "Input Error!"=c; } cout<<b<<c; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:11:19: error: assignment of read-only location '"Input Error!"'
     "Input Error!"=b;
                   ^
Main.cc:11:19: error: incompatible types in assignment of 'int' to 'const char [13]'
Main.cc:14:19: error: assignment of read-only location '"Input Error!"'
     "Input Error!"=c;
                   ^
Main.cc:14:19: error: incompatible types in assignment of 'int' to 'const char [13]'