36592023-03-01 19:55:13PeterOszthatóság 31-gyelcsharpRuntime error 44/5028ms23532 KiB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace oszthatosag_31_el
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            int utolsoszamjegy = N % 10;
            List<int> koztesertekek = new List<int>();
            
            while (N>0)
            {
                N = int.Parse(N.ToString().Substring(0, N.ToString().Length - 1)); 
                N = N - (3 * utolsoszamjegy);
                utolsoszamjegy = N % 10;
                koztesertekek.Add(N);
            }
            if (koztesertekek[koztesertekek.Count-1]<0)
            {
                koztesertekek.RemoveAt(koztesertekek.Count - 1);
            }

            if (N==0)
            {
                Console.WriteLine("IGEN");
            }
            else
            {
                Console.WriteLine("NEM");
            }

            //Köztes értékek kiíratása
            foreach (var item in koztesertekek)
            {
                Console.Write(item+" ");
            }

            Console.ReadKey();
        }
    }
}
SubtaskSumTestVerdictTimeMemory
base44/50
1Accepted0/028ms20424 KiB
2Accepted0/028ms20904 KiB
3Accepted3/328ms20560 KiB
4Accepted3/328ms20716 KiB
5Accepted4/428ms20932 KiB
6Accepted4/428ms20820 KiB
7Accepted4/428ms21592 KiB
8Accepted4/428ms21520 KiB
9Accepted4/428ms21984 KiB
10Accepted4/428ms22168 KiB
11Accepted4/428ms22260 KiB
12Runtime error0/428ms22364 KiB
13Accepted4/428ms23180 KiB
14Accepted4/428ms23532 KiB
15Accepted2/228ms23232 KiB
16Wrong answer0/228ms23520 KiB