📜  在模N等于N的情况下，具有N个乘法逆的N的最接近的较小数

📅  最后修改于: 2021-04-22 09:16:19             🧑  作者: Mango

C++
// C++ program to implement
// the above approach

#include
using namespace std;

// Function to find the nearest
// smaller number satisfying
// the condition
int clstNum(int N)
{
return (N - 1);
}

// Driver Code
int main()
{
int N = 11;
cout << clstNum(N);
}

Java
// Java program to implement
// the above approach
import java.io.*;

class GFG{

// Function to find the nearest
// smaller number satisfying
// the condition
static int clstNum(int N){ return (N - 1); }

// Driver Code
public static void main(String[] args)
{
int N = 11;

System.out.println(clstNum(N));
}
}

// This code is contributed by akhilsaini

Python3
# Python3 program to implement
# the above approach

# Function to find the nearest
# smaller number satisfying
# the condition
def clstNum(N):
return (N - 1)

# Driver Code
if __name__ == '__main__':

N = 11

print(clstNum(N))

# This code is contributed by akhilsaini

C#
// C# program to implement
// the above approach
using System;

class GFG{

// Function to find the nearest
// smaller number satisfying
// the condition
static int clstNum(int N){ return (N - 1); }

// Driver Code
public static void Main()
{
int N = 11;

Console.Write(clstNum(N));
}
}

// This code is contributed by akhilsaini

10