Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string Line;
- Console.WriteLine("Kérek egy sort:");
- do
- {
- Line = Console.ReadLine();
- } while (Line.Length == 0);
- bool SzámKeres = NumberSearch(Line);
- if (SzámKeres)
- {
- Console.WriteLine("A sorban volt szám.");
- }
- else
- {
- Console.WriteLine("A sorban nem volt szám.");
- }
- }
- static bool NumberSearch(string Sor)
- {
- for (int i = 0; i < Sor.Length; i++)
- {
- if (Sor[i] >= '0' && Sor[i] <= '9'){
- return true;
- }
- }
- return false;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement