Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
66977 标准课程 寻找绝对素数 C++ Compile Error 0 MS 0 KB 405 2024-03-12 19:28:36

Tests(0/0):


Code:

char d[16] = { '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' }; int turn(int x,int A) { int r; r = x % A; x = x / A; if (x != 0) turn(x, A); cout<< d[r];//用ASCII码转会比较麻烦,9和A之间隔了几个符号. return 0; } int main() { int x, m; cin >> x >> m; turn(x, m); cout << endl; return 0; }


Run Info:

Main.cc: In function 'int turn(int, int)':
Main.cc:9:5: error: 'cout' was not declared in this scope
     cout<< d[r];//用ASCII码转会比较麻烦,9和A之间隔了几个符号.
     ^
Main.cc: In function 'int main()':
Main.cc:17:5: error: 'cin' was not declared in this scope
     cin >> x >> m;
     ^
Main.cc:19:5: error: 'cout' was not declared in this scope
     cout << endl;
     ^
Main.cc:19:13: error: 'endl' was not declared in this scope
     cout << endl;
             ^