小编Jua*_*uan的帖子

确定n和交换n之和的所有数字是否都是奇数

我需要确定n个数和被交换n之和的所有数字是否都是奇数.

例如:

36 + 63 = 99(9和9都是奇数)

409 + 904 = 1313(1和3都是奇数)

Visual Studio构建我的代码并运行,但它不会返回答案.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            long num = Convert.ToInt64(Console.Read());
            long vol = voltea(num);
            long sum = num + vol;

            bool simp = simpares(sum);

            if (simp == true)
                Console.Write("Si");
            else
                Console.Write("No");

        }

        static private bool simpares(long x)
        {
            bool s = false;
            long [] arreglo  = new long [1000];
            while ( x > …
Run Code Online (Sandbox Code Playgroud)

c#

0
推荐指数
1
解决办法
756
查看次数

标签 统计

c# ×1