![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法入门
liubin477
这个作者很懒,什么都没留下…
展开
-
统计一组数据中出现次数最多的数(map实现)
#include <iostream> #include <map> using namespace std; int main(){ int n; cin>>n; map<float,int> m;//保存输入 for(int i=0; i<n; i++){ float tmp; ...原创 2018-05-01 09:58:07 · 2387 阅读 · 0 评论 -
scanf("%d")过滤字符
#include <iostream> using namespace std; int main(){ int tmp,t,a[1000],count=0; while((t=scanf("%d",&tmp)) != EOF){ if(!t) //scanf函数接收整型数字要跳过所有非数字的字符专接收数字。那么如果输入了...原创 2018-05-01 10:38:51 · 2309 阅读 · 0 评论 -
C++计算阶乘(大数)
#include <iostream> #include <cstring> using namespace std; const int MAXN = 3000; int ans[MAXN];//0个位,1十位... int main(){ int n; cin>>n; memset(ans,0,sizeof(ans));//数组置...原创 2018-05-01 15:40:23 · 5799 阅读 · 0 评论