Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program {
- /*public static bool IsAllDigits(string s)
- {
- foreach (char c in s)
- {
- if (!char.IsDigit(c))
- return false;
- }
- return true;
- }*/
- public static int Main() {
- Console.Write("Введите строку : ");
- string S = Console.ReadLine();
- string str = "";
- for (int i = 0; i < S.Length; i++)
- {
- if (!char.IsDigit(S[i]))
- {
- str += S[i];
- } /*else if (IsAllDigits(S)) { str = "only numbers"; }*/
- }
- Console.WriteLine(str);
- Console.ReadKey();
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement