KpucTaJl

Картинки

Aug 28th, 2023
1,053
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | None | 0 0
  1. using System;
  2.  
  3. namespace CSLight
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.Write("Введите кол-во картинок в одном ряду: ");
  10.             int countInRow = Convert.ToInt32(Console.ReadLine());
  11.  
  12.             Console.Write("Введите общее кол-во картинок: ");
  13.             int countAll = Convert.ToInt32(Console.ReadLine());
  14.  
  15.             int countRow = countAll / countInRow;
  16.             int remainderOfDivision = countAll % countInRow;
  17.  
  18.             Console.WriteLine($"Кол-во полностью заполненных рядов: {countRow}\nКол-во оставшихся картинок в последнем ряду: {remainderOfDivision}");
  19.             Console.ReadKey();
  20.         }
  21.     }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment