摘要: 题解思路很清奇,觉得不错保存了! #include<iostream> #include<cstring> using namespace std; int main(){ char c[256]; cin>>c; int l=strlen(c),m=0,g=0; for(int i=0;i<l;i 阅读全文
posted @ 2023-03-28 20:43 Rosemary~ 阅读(27) 评论(0) 推荐(0)
摘要: 一、sqrt函数作用 sqrt是用来求一个数的开根的,等同于开根号。 二、使用时需要的头文件 #include<cmath> 三、基本用法及注意事项 sqrt(需要开根的内容) sqrt函数只能对double、float类型!不过可以用强制类型转换,像这样: c=(int) sqrt((double 阅读全文
posted @ 2022-11-02 19:38 Rosemary~ 阅读(4482) 评论(0) 推荐(0)
摘要: 刚打开VC++的我非常懵,然后去CSDN搜了一下,解决方法如下: CSDN博客网址:https://blog.csdn.net/qq_51329441/article/details/120911215?ops_request_misc=&request_id=&biz_id=102&utm_ter 阅读全文
posted @ 2022-10-16 17:14 Rosemary~ 阅读(57) 评论(0) 推荐(0)
摘要: #include<iostream>#include<algorithm>using namespace std;int main(){ int p[100]; int i,n,sum=0; cin>>n; for(i=0;i<n;i++) cin>>p[i]; sort(p,p+n); while 阅读全文
posted @ 2022-03-26 17:24 Rosemary~ 阅读(33) 评论(0) 推荐(0)
摘要: 用法: 1、sort函数可以三个参数也可以两个参数,必须的头文件#include < algorithm>和using namespace std;2、它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(n) 3、Sort函数有三个参数:(第三个参数可不写) (1)第一个是要排序的数组的起 阅读全文
posted @ 2022-03-26 17:07 Rosemary~ 阅读(280) 评论(0) 推荐(0)
摘要: #include<stdio.h>#include<string.h>int main(){ char aa[1000],bb[1000]; int a[1000],b[1000]; int len,i; scanf("%s%s",aa,bb); int l1=strlen(aa); int l2= 阅读全文
posted @ 2022-03-26 16:46 Rosemary~ 阅读(23) 评论(0) 推荐(0)
摘要: #include<iostream>#include<vector>//C++ 容器 详见下方链接using namespace std;vector<int> v;//声明了一个int数组v[],大小没有指定,可以动态的向里面添加删除int main(){ int n,i,j,t; cin>>n; 阅读全文
posted @ 2022-03-21 20:47 Rosemary~ 阅读(71) 评论(0) 推荐(1)
点击右上角即可分享
微信分享提示