fork download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. public class Test{
  5. public static void Main(){
  6. var ls = new LinkedList<String>();
  7. for(int i=0; i<10; i++){ls.AddFirst(""+(char)('A'+i));}
  8. f(ls);
  9. }
  10.  
  11. static void f<T>(ICollection<T> c){
  12. f(c, c.Count);
  13. }
  14.  
  15. static void f<T>(IEnumerable<T> c, int cnt){
  16. int ix=1;
  17. foreach(T et in c){
  18. Console.WriteLine("({0,3}% : {1}/{2}) {3}", ix*100/cnt, ix, cnt, et);
  19. ix++;
  20. }
  21. }
  22. }
Success #stdin #stdout 0.03s 36992KB
stdin
Standard input is empty
stdout
( 10% : 1/10) J
( 20% : 2/10) I
( 30% : 3/10) H
( 40% : 4/10) G
( 50% : 5/10) F
( 60% : 6/10) E
( 70% : 7/10) D
( 80% : 8/10) C
( 90% : 9/10) B
(100% : 10/10) A