首页
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
James
2021年1月24日 17:13
getline使用注意
P1261
回复 0
|
赞 0
|
浏览 9.0k
#include <bits/stdc++.h> using namespace std; struct node{ string s; int len; }; node a[1001]; bool cmp(node x,node y){ return x.len<y.len; } int n; string t; int main(){ while(scanf("%d",&...
老猫
2021年1月13日 11:20
1
P1261
回复 0
|
赞 1
|
浏览 7.5k
#include <iostream> #include <string> #include <string.h> #include<algorithm> using namespace std; struct stre { string s; int len; }str[500]; bool compare(stre a,stre b) { return a.len <b.len ; } int main() { string s; int n; while(cin>&g...
tyu007
2020年3月30日 00:19
1261(记录自己,憨批时刻)
P1261
回复 2
|
赞 3
|
浏览 12.0k
#include<iostream> #include<string> #include<algorithm> using namespace std; bool cmp(string a,string b) { int k,l; k=a.size(); l=b.size(); return k<l; } int main() { int n; while(cin>>n)// 题目最后一行,while循环输入,就是这句,原封不动 { int i=0; ...
1
2
3
题目
字符串排序3
题解数量
23
发布题解
在线答疑
热门题解
1
注意使用getchar写cmp函数 size() 比较大小就可以了
2
字符串排序3 题解:使用vector +sort(),此方法适用于多种场景
3
字符串排序3 题解:getchar compare自定义
4
字符串排序3(C++) 题解:
5
字符串排序3 题解 使用getline前需要用getchar()吸收换行符
6
字符串排序3 题解:
7
getline与cin一起使用的问题
8
字符串排序3 题解:
9
字符串排序3 题解:
10
字符串排序3 题解: