| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 361933 | 丁虞轩 | 【C5-8】余数排序 | C++ | 解答错误 | 0 | 1 MS | 244 KB | 291 | 2025-11-21 20:25:50 |
#include<bits/stdc++.h> using namespace std; bool cmp(int x,int y){ if(x%3<y%3)return x%3<y%3; return x<y; } int main(){ int n; cin>>n; int a[15]; for(int i=1;i<=n;i++){ cin>>a[i]; } sort(a+1,a+n+1,cmp); for(int i=1;i<=n;i++){ cout<<a[i]<<" "; } return 0; }