首页
比赛
tracker
题库
课程
竞赛讨论区
登录
/
注册
去牛客
首页
>
大整数排序
28条解析
开通博客写题解
鱼儿恋上水
发表于 2020-04-06 16:22:51
简单的字符串排序,用到了sort()函数,关键在于cmp规则的编写 #include <iostream> #include <cstring> #include <string> #include <algorithm> using namespac
展开全文
CyberAoao
发表于 2023-03-20 10:34:07
直接给每个数字前面添0到相同长度,再直接比较字符串,简单粗暴_(:з」∠)_ #include <iostream> #include <string> #include <vector> #include <algorithm> using name
展开全文
ruuioche
发表于 2024-01-31 20:15:27
#include <stdio.h> #include <string.h> #include <math.h> #include <stdlib.h> typedef struct in_num { char num[1001];
展开全文
木何
发表于 2023-03-05 21:44:08
#include<iostream> #include<cstring> using namespace std; bool jude(string s1, string s2) { //判断s1是否比s2大 if (s1.size() < s2.size(
展开全文
在考古的小鱼干很有气魄
发表于 2023-03-07 12:37:00
#include <bits/stdc++.h> #define MAX 1000 using namespace std; bool cmp(vector<int> a, vector<int> b) { int lena = a.size(), le
展开全文
热心市民小喷
发表于 2020-03-05 17:11:27
//思路:最近在练习大整数,所以用大整数,可以直接用string类的比较大小的方法,长度相同的比较每一位,不同的则长的大 //string 用大整数储存法,然后定义结构体,重载<符号, //用sort进行排序 #include<iostream> #include<
展开全文
救世歌姬
发表于 2026-03-03 14:19:00
1、自定义vector容器排序函数2、长度相同的大整数排序直接可以对比string的值
牛客440904392号
发表于 2024-10-07 17:09:01
//C++版代码 #include <iostream> #include <algorithm> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(null
展开全文
爱交友的马后炮炮手在创作
发表于 2024-03-03 14:48:46
#include <stdio.h> #include <string.h> int comp(char a[100],char b[100]){ int i=strlen(a),j=strlen(b); if(i>j)return 1; els
展开全文
lovekang
发表于 2024-09-09 10:57:46
加油,就是字符串排序。不过这里我们需要稍微改进一下默认的排序。 #include <iostream> #include <algorithm> #include <vector> #include <string.h> using namespace
展开全文
查看本题
查看本题讨论
相关比赛
31-河北师范大学软件学院第一届程序设计大赛
进入比赛
48-河北师范大学软件学院-编程小课堂阶段小测
进入比赛
等你来战
查看全部
牛客挑战赛88
报名截止时间:2026-05-15 22:00
牛客周赛 Round 144
报名截止时间:2026-05-17 21:00
2026年北京印刷学院程序设计竞赛(同步赛)
报名截止时间:2026-05-20 18:00
牛客练习赛153
报名截止时间:2026-05-22 21:30
2026年中南民族大学程序设计竞赛决赛(同步赛)
报名截止时间:2026-05-23 17:00
"壹零杯"第三届西华师范大学程序设计竞赛(同步赛)
报名截止时间:2026-05-24 14:30
牛客周赛 Round 145
报名截止时间:2026-05-24 21:00
汤圆头 Round 1
报名截止时间:2026-07-06 22:00
2026牛客暑期多校训练营1
报名截止时间:2026-07-16 17:00
扫描二维码,关注牛客
意见反馈
下载牛客APP,随时随地刷题