using System;
namespace ConsoleApp3
{
class Program
static void Main(string[] args)
Console.WriteLine("Введите N и K");
int N = Int32.Parse(Console.ReadLine());
int K = Int32.Parse(Console.ReadLine());
int H = 0;
int ost = 0;
do
N -= K;
H+=1;
} while (N >= K);
ost = N;
Console.WriteLine(H + " целых частей");
Console.WriteLine(ost + " остаток");
}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
using System;
namespace ConsoleApp3
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Введите N и K");
int N = Int32.Parse(Console.ReadLine());
int K = Int32.Parse(Console.ReadLine());
int H = 0;
int ost = 0;
do
{
N -= K;
H+=1;
} while (N >= K);
ost = N;
Console.WriteLine(H + " целых частей");
Console.WriteLine(ost + " остаток");
}
}
}