Advertisement
Guest User

Untitled

a guest
May 14th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using System;
  2. namespace Feladat
  3. {
  4.     class Program
  5.     {
  6.         static void Main(string[] args)
  7.         {
  8.             // Kezdő érték 0. Ezután számokat kell beírni egymás után, addig, amíg 2 egymásutáni szám nem azonos.
  9.      
  10.             int eszam=0;
  11.             int ujszam;
  12.             bool tovabb=true;
  13.             while (tovabb){
  14.                 while(!int.TryParse(Console.ReadLine(), out ujszam)) Console.WriteLine("jo számot, légy szíves...");
  15.                 if (eszam!=ujszam) eszam=ujszam; else tovabb=false;
  16.             };
  17.            
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement