Advertisement
desislava_topuzakova

1. Числата от 1 до N през 3

Nov 27th, 2021
828
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _01._Numbers_1_to_n_over_3
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int n = int.Parse(Console.ReadLine());
  10.             //отпечатва числата от 1 до n през 3
  11.             //начало: 1
  12.             //край: n
  13.             //повтаряме: печатаме числото
  14.             //промяна:  +3
  15.             for (int number = 1; number <= n; number += 3)
  16.             {
  17.                 Console.WriteLine(number);
  18.             }
  19.  
  20.         }
  21.     }
  22. }
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement