我需要确定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# ×1