【L1-003个位数统计】

#include
#include
using namespace std;
int a[10];//默认数组中元素为0
string str;
int main()
{
	cin >> str;
	for (int i = 0; i < str.length(); i++)
	{
		a[str[i] - 48]++;
	}
	for (int i = 0; i < 10; i++)
	{
		if (a[i] != 0)
		{
			cout<

你可能感兴趣的:(算法,c++,数据结构)