要は、入力された文字列の中に '1' が何個出現するかを数えればいいわけだ。
using System; using System.Linq; namespace ABC081A { class Program { static void Main(string[] args) { var answer = Console.ReadLine().Count(x => x == '1'); Console.WriteLine(answer); } } }
要は、入力された文字列の中に '1' が何個出現するかを数えればいいわけだ。
using System; using System.Linq; namespace ABC081A { class Program { static void Main(string[] args) { var answer = Console.ReadLine().Count(x => x == '1'); Console.WriteLine(answer); } } }