Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
98114 杨政翰 07大小写转换 C++ Compile Error 0 MS 0 KB 486 2024-11-17 13:03:38

Tests(0/0):


Code:

#include<iostream> using namespace std; int main() { char c; cin >> c; if(c >= "a") { if(c >= "z") c = c - 32; } else { if(c >="A") { if(c <='Z') c = c + 32; } } cout<<c<<endl return 0; }


Run Info:

Main.cc:14:22: error: stray '\357' in program
                      if(c >="A")
                      ^
Main.cc:14:22: error: stray '\274' in program
Main.cc:14:22: error: stray '\210' in program
Main.cc: In function 'int main()':
Main.cc:7:18: warning: comparison with string literal results in unspecified behaviour [-Waddress]
          if(c >= "a")
                  ^
Main.cc:7:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
Main.cc:9:29: warning: comparison with string literal results in unspecified behaviour [-Waddress]
                     if(c >= "z")
                             ^
Main.cc:9:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
Main.cc:14:27: error: expected '(' before 'c'
                      if(c >="A")
                           ^
Main.cc:21:10: error: expected ';' before 'return'
          return 0;
          ^