| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 147296 | sunn | 分割排序 | C++ | Compile Error | 0 MS | 0 KB | 507 | 2026-02-04 08:34:43 |
#include <bits/stdc++.h> using namespace std; string s; int a[110]; int sum=0; void divide(string s){ for(int i=0;i<s.size();i++){ if(s[i]=='5'){ string test=""; for(int j=0;j<i;j++){ test+=s[j]; } test=int(test); a[i]=test; sum++; } } } int main(){ cin>>s; divide(s); sort(a,a+s.size()); for(int i=0;i<sum;i++){ cout<<a[i]; } return 0; }
Main.cc: In function 'void divide(std::__cxx11::string)':
Main.cc:8:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i}' to type 'int'
test=int(test);
^
Main.cc:15:17: error: cannot convert 'std::__cxx11::string {aka std::__cxx11::basic_string}' to 'int' in assignment
a[i]=test;
^