RedFlys

Home work - pictures in row

Jul 2nd, 2021
1,644
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1. using System;
  2.  
  3. namespace HomeWork
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int pictures = 52;
  10.             int numberInRow = 3;
  11.  
  12.             int numberOfRow;
  13.             int picturesLeft;
  14.  
  15.             numberOfRow = pictures / numberInRow;
  16.             picturesLeft = pictures % numberInRow;
  17.  
  18.             Console.WriteLine($"Всего получиться {numberOfRow} рядов. Останется разместить {picturesLeft} картину.");
  19.             Console.ReadKey();
  20.         }
  21.     }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment