Advertisement
Guest User

jkhkjhj

a guest
Dec 7th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 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.  
  7. namespace java_8
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Console.WriteLine("Shkruani nje numer: ");
  14. int numri = int.Parse(Console.ReadLine());
  15. string pergjigja;
  16.  
  17. do
  18. {
  19. Console.WriteLine("Qift/Tek");
  20. pergjigja = Console.ReadLine();
  21. }
  22. while ( pergjigja != "Qift" && pergjigja != "Tek");
  23.  
  24.  
  25.  
  26. for (int i = 1; i <= numri; i++)
  27. {
  28. if (pergjigja == "Qift")
  29. {
  30. if (i % 2 == 0)
  31. {
  32. Console.WriteLine(i);
  33. }
  34.  
  35.  
  36. }
  37. else if (pergjigja == "Tek")
  38. {
  39. if (i % 2 != 0)
  40. {
  41. Console.WriteLine(i);
  42. }
  43.  
  44. }
  45. else
  46. {
  47.  
  48. }
  49. }
  50. {
  51. Console.WriteLine(numri);
  52. }
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement