Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
101784 张智博 12输出英文字母 C++ Compile Error 0 MS 0 KB 236 2024-12-18 20:53:58

Tests(0/0):


Code:

#include <iostream> using namespace std; int main() { char i; for (i = "a"; i <= "z"; i++) cout << i << " "; cout<<endl; for(i = "Z"; i <= "A"; i--) cout << i << " "; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:12: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
     for (i = "a";  i <= "z"; i++) 
            ^
Main.cc:7:25: warning: comparison with string literal results in unspecified behaviour [-Waddress]
     for (i = "a";  i <= "z"; i++) 
                         ^
Main.cc:7:25: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
Main.cc:11:11: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
     for(i = "Z";  i <= "A"; i--)
           ^
Main.cc:11:24: warning: comparison with string literal results in unspecified behaviour [-Waddress]
     for(i = "Z";  i <= "A"; i--)
                        ^
Main.cc:11:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]