06 2020 档案

摘要:题目如下: 1.主要是约分!!! 可以利用__gcd()来找最大公因数 代码如下: #include<cstdio> #include<algorithm> #include<iostream> using namespace std; int main(){ int a[3],x; for(int 阅读全文
posted @ 2020-06-28 23:09 miao-xixixi 阅读(181) 评论(0) 推荐(0) 编辑
摘要:1.头文件 #include<algorithm> 2.作用 求两个数的最大公约数 3.注意语法 是两个下划线!!! 阅读全文
posted @ 2020-06-28 23:00 miao-xixixi 阅读(518) 评论(0) 推荐(0) 编辑
摘要:题目如下: 思路: 1.利用stl unique来去重 2.题目意思就是找有多少种数字 代码如下: #include<cstdio> #include<cmath> #include<algorithm> #include<iostream> using namespace std; int mai 阅读全文
posted @ 2020-06-28 22:48 miao-xixixi 阅读(122) 评论(0) 推荐(0) 编辑
摘要:1.作用:去重,删除所有相邻位置的重复元素 2.使用之前先排序 sort() 3.头文件 #include<algorithm> 4.用法: int sum=unique(b,b+10)-b; 阅读全文
posted @ 2020-06-28 22:36 miao-xixixi 阅读(297) 评论(0) 推荐(0) 编辑
摘要:题目如下: 代码如下: #include<cstdio> #include<cmath> #include<iostream> using namespace std; int n; bool f(int x){ for(int i=2;i<sqrt(n);i++){ if(x%i==0&&x!=i 阅读全文
posted @ 2020-06-27 16:54 miao-xixixi 阅读(198) 评论(0) 推荐(0) 编辑
摘要:题目如下: 思路: 1.数据很小 可以开数组解决 代码如下: #include<cstdio> #include<iostream> using namespace std; int a[1010][1010]; int ans=0,n; bool flag=false; int f(int i,i 阅读全文
posted @ 2020-06-26 10:10 miao-xixixi 阅读(251) 评论(0) 推荐(0) 编辑
摘要:题目如下: 思路: 1.可能回想着如何把字符串转换为数字 2.其实可以利用c++ 代码如下: #include<cstdio> #include<iostream> using namespace std; int main(){ int a; int sum=0; while(cin>>a) su 阅读全文
posted @ 2020-06-13 18:38 miao-xixixi 阅读(188) 评论(0) 推荐(0) 编辑
摘要:1. 阅读全文
posted @ 2020-06-13 11:27 miao-xixixi 阅读(103) 评论(0) 推荐(0) 编辑
摘要:1.字典序:从小到大的顺序 阅读全文
posted @ 2020-06-12 18:17 miao-xixixi 阅读(206) 评论(0) 推荐(0) 编辑
摘要:题目如下: 思路: 1.考虑开头就是) 肯定NO 2.每次输入一个数字一定是左括号大于等于右括号,否则NO 3.其余就是左右括号数目相等 代码如下: #include<cstdio> #include<iostream> using namespace std; int main(){ char a 阅读全文
posted @ 2020-06-12 17:41 miao-xixixi 阅读(220) 评论(0) 推荐(0) 编辑
摘要:题目如下: 思路: f(x,z)=y 已知x,y 求z 1.有解:y是最小的,z可以等于y本身(只需要求一个符合条件的z) 2.无解:y比x中字母的大 代码如下: #include<cstdio> #include<iostream> using namespace std; int main(){ 阅读全文
posted @ 2020-06-08 11:33 miao-xixixi 阅读(182) 评论(0) 推荐(0) 编辑
摘要:题目如下: 思路: 1.输入完成后会按enter 要记得\n也会被计入数字喔! 代码: #include<cstdio> #include<cstring>> #include<iostream> using namespace std; int main(){ string ss; getline 阅读全文
posted @ 2020-06-03 12:05 miao-xixixi 阅读(332) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示