1021
来源:互联网 发布:达芬奇调色软件语言 编辑:程序博客网 时间:2024/04/29 12:12
学习
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include<limits>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
string a;
cin>>a;
//int a0=0,a1=0,a2=0,a3=0,a4=0,a5=0,a6=0,a7=0,a8=0,a9=0;
int b[10]={0};
for(int i=0;i<a.length();i++){
if (a[i]=='0') b[0]++;
else if (a[i]=='1') b[1]++;
else if (a[i]=='2') b[2]++;
else if (a[i]=='3') b[3]++;
else if (a[i]=='4') b[4]++;
else if (a[i]=='5') b[5]++;
else if (a[i]=='6') b[6]++;
else if (a[i]=='7') b[7]++;
else if (a[i]=='8') b[8]++;
else b[9]++;
}
for(int i=0;i<10;i++){
if(b[i]==0) continue;
else cout<<i<<':'<<b[i]<<endl;
}
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int len = s.length();
int a[10] = {0};
for (int i = 0; i < len; i++) {
a[s[i] - '0']++;
}
for (int i = 0; i < 10; i++) {
if (a[i] != 0) {
cout << i << ":" << a[i] << endl;
}
}
return 0;
}
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include<limits>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
string a;
cin>>a;
//int a0=0,a1=0,a2=0,a3=0,a4=0,a5=0,a6=0,a7=0,a8=0,a9=0;
int b[10]={0};
for(int i=0;i<a.length();i++){
if (a[i]=='0') b[0]++;
else if (a[i]=='1') b[1]++;
else if (a[i]=='2') b[2]++;
else if (a[i]=='3') b[3]++;
else if (a[i]=='4') b[4]++;
else if (a[i]=='5') b[5]++;
else if (a[i]=='6') b[6]++;
else if (a[i]=='7') b[7]++;
else if (a[i]=='8') b[8]++;
else b[9]++;
}
for(int i=0;i<10;i++){
if(b[i]==0) continue;
else cout<<i<<':'<<b[i]<<endl;
}
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main() {
string s;
cin >> s;
int len = s.length();
int a[10] = {0};
for (int i = 0; i < len; i++) {
a[s[i] - '0']++;
}
for (int i = 0; i < 10; i++) {
if (a[i] != 0) {
cout << i << ":" << a[i] << endl;
}
}
return 0;
}
0 0
- 1021
- 1021
- 1021
- 1021
- 1021
- 1021
- 1021
- 1021
- 1021
- 1021
- 1021
- 1021
- hdu 1021 hdoj 1021
- ora-1021
- sicily 1021
- hdu 1021
- sicily 1021
- hdu 1021
- 学好Windows编程要看的书籍
- 软件反破解的几个思路
- Shell中$# $@等含义
- 第一次面试
- VB编程:获取文件夹下所有文件-1
- 1021
- PTA 最大子列和问题
- UGUI 标签流(流式布局)
- ARIA库 2.9.0与VS 2012 配置步骤
- Android自定义雷达扫描控件
- 再myeclipse中使用 maven 进行 spring开发的时候, 添加c3p0后报错
- c++多态虚表
- 博主在北京西站地铁上被偷了一块移动硬盘
- pdb