Last active
August 9, 2024 07:13
-
-
Save Strelok78/7469dd733bbdec7476f75ca18e14d37e to your computer and use it in GitHub Desktop.
On the screen, in a special area, pictures are displayed, 3 in a row. In total, the user has 52 pictures in the album. The code outputs how many fulfilled rows it will be possible to output, and how many pictures will be beyond measure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MyCode | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int amountOfPictures = 52; | |
int countOfRows; | |
int amountOfExtraPictures; | |
int numberOfPicturesInRow = 3; | |
countOfRows = amountOfPictures / numberOfPicturesInRow; | |
amountOfExtraPictures = amountOfPictures % numberOfPicturesInRow; | |
Console.WriteLine($"Number of rows: {countOfRows}, number of over-the-top images: {amountOfExtraPictures}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment