Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
77804 孙睿阳 字符的前导值和后继值 C++ Compile Error 0 MS 0 KB 292 2024-06-15 14:12:51

Tests(0/0):


Code:

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


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:2: error: expected initializer before 'cin'
  cin.get(b);
  ^
Main.cc:8:2: error: 'c' was not declared in this scope
  c=b+1;
  ^