Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.IO;
  7.  
  8. namespace ConsoleApp1
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. using (StreamReader sr = new StreamReader("mertertekek.csv",Encoding.Default))
  15. {
  16. int viz = 0;
  17. int jég = 0;
  18. int gőz = 0;
  19. while (!sr.EndOfStream)
  20. {
  21. string olvas = sr.ReadLine();
  22. int a = Convert.ToInt32(olvas);
  23.  
  24. if (a>100)
  25. {
  26. gőz++;
  27.  
  28. }
  29. if (a<0)
  30. {
  31. jég++;
  32. }
  33. else
  34. {
  35. viz++;
  36. }
  37. }
  38. Console.WriteLine("Halamzállapot"+gőz);
  39. Console.WriteLine("Halmazállapot"+jég);
  40. Console.WriteLine("Halmazállapot"+viz);
  41.  
  42. }
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement