Skip to content

Instantly share code, notes, and snippets.

@Strelok78
Last active August 9, 2024 07:13
Show Gist options
  • Save Strelok78/7469dd733bbdec7476f75ca18e14d37e to your computer and use it in GitHub Desktop.
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.
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