1742: 字符串内排序__题解(C++ 冒泡排序)
摘要:解题思路:用冒泡排序法进行排序注意事项:见代码参考代码:#include <bits/stdc++.h>using namespace std;int main(){ string s; ……
不要使用scanf函数,因为scanf不存储空格
摘要:这道题我最开始使用scanf输入,然后提交只能过50%
```c
#include
#include
#include
int cmp(const void *a,const void……
字符串内排序 vector
摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h"
using namespace std;
int main(){
// 定义一个字符串变量,用于存储输入的一……
使用gets不能使用fgets,原因:笔者认为第二个测试用例太长了,超过了一行,因此使用gets无限制读取,直到读到空格和回撤符号
摘要:#include<stdio.h>#include<string.h>#include<stdlib.h>int compare(const void *p1,co……
使用scanf读取空格,在多次读取时候需要把\n用getchar()读取,不然会产生死循环
摘要:#define_CRT_SECURE_NO_WARNINGS1#include<stdio.h>charstr[210];int……