Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.IO;
  4. using System.Collections.Generic;
  5.  
  6. namespace rim
  7. {
  8.  
  9. class Program
  10. {
  11.  
  12. static void Main(string[] args)
  13. {
  14.  
  15. List<int> dob = new List<int>();
  16. int count1 = 0, count2 = 0;
  17. for (int i = 0; i < 10; i++)
  18. {
  19. string[] str = Console.ReadLine().Split(' ');
  20. for (int j = 0; j < 13; j++)
  21. {
  22. count1++;
  23. dob.Add(int.Parse(str[j]));
  24. }
  25. }
  26.  
  27. dob.Sort();
  28.  
  29. Console.WriteLine("Variation series");
  30. int ten = 0;
  31. foreach (var item in dob)
  32. {
  33. Console.Write(item + " ");
  34. if (++ten % 13 == 0) Console.WriteLine();
  35. }
  36.  
  37. Console.WriteLine("Intervals");
  38. double k = dob[0];
  39. double last_interval = 0;
  40. double step = (dob.Max() - dob.Min()) / 10.0;
  41. Console.WriteLine($"Step is: {step}");
  42. int index = 0;
  43. int all = 0;
  44. for (int i = 0; i < 10; i++)
  45. {
  46.  
  47. if (i == 9)
  48. count2 += 0;
  49. Console.Write($"{k:F1} - ");
  50. last_interval = k;
  51. k += step;
  52. int count = 0;
  53.  
  54. while (dob[index] < k)
  55. {
  56. if (dob[index++] >= last_interval)
  57. count++;
  58. }
  59. all += count;
  60. Console.WriteLine($"{k} : {count}");
  61. }
  62. Console.WriteLine($"All:{all}");
  63.  
  64. int mo = dob.Sum()/130;
  65. Console.WriteLine($"MO:{mo}");
  66. double d = dob.Sum(e=>Math.Pow((e-mo),2))/129;
  67. Console.WriteLine($"D:{d}");
  68.  
  69.  
  70. Console.ReadLine();
  71. }
  72. }
  73. }
  74.  
  75. //288 284 291 268 265 280 382 290 335 353 440 353 400
  76. //366 338 315 384 367 328 388 348 360 409 311 336 280
  77. //290 335 353 400 335 300 361 360 325 345 349 307 344
  78. //323 360 397 379 334 399 352 349 361 385 333 377 347
  79. //321 359 449 356 343 391 332 375 345 358 320 342 420
  80. //352 368 331 373 357 339 319 309 341 335 367 375 371
  81. //292 356 317 340 329 334 366 383 332 354 313 328 425
  82. //295 355 345 339 334 365 379 349 401 367 364 386 318
  83. //407 381 337 289 366 369 384 347 405 360 344 336 306
  84. //350 369 403 346 362 326 346 340 385 419 351 356 377
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement