
출제 링크 : https://www.acmicpc.net/problem/2577
2577번: 숫자의 개수
첫째 줄에 A, 둘째 줄에 B, 셋째 줄에 C가 주어진다. A, B, C는 모두 100보다 크거나 같고, 1,000보다 작은 자연수이다.
www.acmicpc.net
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Solution
{
class Program
{
static void Main(string[] args)
{
int num = 3;
int[] input_Num = new int[num];
int result=1;
int count = 0;
//AxBxC의 값
for(int i=0; i<num; i++)
{
input_Num[i] = int.Parse(Console.ReadLine());
result *= input_Num[i];
}
//곱한 결과를 char형으로 하나하나 변환
char[] pieceNum = result.ToString().ToCharArray();
//pieceNum의 값을 분석
for(int i=0; i<10;i++)
{
for(int j=0;j<pieceNum.Length;j++)
{
if(pieceNum[j].ToString() == i.ToString())
{
count++;
}
}
Console.WriteLine(count);
count = 0;
}
}
}
}
