Advertisement
SaNik74

Basics of programming. Lesson #4. Pictures

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