fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace WindowsFormsApplication1
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18. List<MyData> data = new List<MyData>();
  19. List<MyData> data0 = new List<MyData>();
  20. List<MyData> data1 = new List<MyData>();
  21. List<MyData> data2 = new List<MyData>();
  22. Button b;
  23. private void Form1_Load(object sender, EventArgs e)
  24. {
  25. data.Clear();
  26. data0.Clear();
  27. data1.Clear();
  28. data2.Clear();
  29. for (int i = 0; i < 30000; i++)
  30. {
  31. MyData d = new MyData();
  32. d.hogehoe = i;
  33. data.Add(d);
  34. if (i < 10000)
  35. {
  36. data0.Add(d);
  37. }
  38. else if (i < 20000)
  39. {
  40. data1.Add(d);
  41. }
  42. else
  43. {
  44. data2.Add(d);
  45. }
  46. }
  47. b = new Button();
  48. b.Text = "実行";
  49. b.Click += new EventHandler(b_Click);
  50. this.Controls.Add(b);
  51. }
  52.  
  53. void b_Click(object sender, EventArgs e)
  54. {
  55. b.Enabled = false;
  56. int i = 29999;
  57. MyData aheahe;
  58. if (i < 10000)
  59. {
  60. aheahe = this.datafind(data0, i);
  61. }
  62. else if (i < 20000)
  63. {
  64. aheahe = this.datafind(data1, i);
  65. }
  66. else
  67. {
  68. aheahe = this.datafind(data2, i);
  69. }
  70. if (aheahe != null) this.Text = aheahe.hogehoe.ToString();
  71. b.Enabled = true;
  72. }
  73. MyData datafind(List<MyData> kkkkkkkk, int number)
  74. {
  75. MyData mmmm = null;
  76. foreach (MyData md in kkkkkkkk)
  77. {
  78. if (md.hogehoe == number)
  79. {
  80. mmmm = md;
  81. break;
  82. }
  83. }
  84. return mmmm;
  85. }
  86. }
  87. public class MyData
  88. {
  89. public int hogehoe;
  90. }
  91. }
  92.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty