Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
count the string
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { string str,str2=""; int count=1,flag=0; str="HelloWorld"; //int n=str.Length-1; //Console.WriteLine(n); for(int i=0;i<str.Length; i++) { foreach(char c in str2) { if(c == str[i]) { flag=1; //continue; break; } } if (flag == 1) { // Console.Write("print"); continue; } for(int j=i+1;j<str.Length;j++) { if (str[i] == str[j]) { count+=1; str2+=str[j]; } else { } } Console.WriteLine("{0} count is{1}",str[i],count); count=1; } } } }
run
|
edit
|
history
|
help
0
Proj2
4
England premiere league results last season
Collatz Conjecture
array print 2nd half first and 1 half later
Find median in a stream
F ?
mendozaeject
2
Tttt