nord vpnnord vpn
Ad

Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.3 kB
1
Indexable
Never
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace NhapThongSoTrucY
{
    class Program
    {
        static void Main(string[] args)
        {
            string conntent = Console.ReadLine();
            string[] words = conntent.Split(' ');
            List<int> primeNumbers = new List<int>();
            foreach (var item in words)
            {
                int h = Convert.ToInt16(item);
                primeNumbers.Add(h);
            }
            string DimX = "C:\\data\\DimX.txt";
            string path = "C:\\data\\listpointY.txt";
            int[] IntArray = { 0, 1050, 3250, 3200, 4050, 3200, 3330, 1200 };
            //int tong = IntArray.Sum();
            int tong = primeNumbers.Sum();
            File.WriteAllText(DimX, Convert.ToString(tong));
            int s = 0;
            foreach (var item in primeNumbers)
            {
                s = s + item;
                if (s < tong)
                {
                    File.AppendAllText(path, Convert.ToString(s));
                    File.AppendAllText(path, " ");
                }
                else
                {
                    File.AppendAllText(path, Convert.ToString(s));
                }
            }
        }
    }
}

nord vpnnord vpn
Ad