Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.79 KB | None | 0 0
  1.  
  2. //Zadata(zadaca)
  3. using System;
  4. class Program
  5. {
  6.  
  7. public static void CWL(string text)
  8. {
  9. Console.WriteLine(text);
  10. }
  11. public static void CRL()
  12. {
  13. Console.ReadLine();
  14. }
  15. public static void Temperatura()
  16. {
  17. Console.WriteLine("\nTemperatura: ");
  18. }
  19.  
  20.  
  21.  
  22. static void Main()
  23. {
  24. int temp, temp1, temp2;
  25. char pad, pad1, pad2;
  26.  
  27.  
  28. CWL("Unesite prognozu za Sarajevo: ");
  29. Temperatura();
  30. temp = Convert.ToInt32(Console.ReadLine());
  31.  
  32. do
  33. {
  34. CWL("Padavine (D ili N): ");
  35. pad = Convert.ToChar(Console.ReadLine());
  36.  
  37. if (pad != 'D' && pad != 'd' && pad != 'N' && pad != 'n')
  38. {
  39. CWL("Pogresan unos!\n");
  40. }
  41.  
  42. } while (pad != 'D' && pad != 'd' && pad != 'N' && pad != 'n');
  43.  
  44.  
  45.  
  46. CWL("Unesite prognozu za Mostar: ");
  47. Temperatura();
  48. temp1 = Convert.ToInt32(Console.ReadLine());
  49.  
  50. do
  51. {
  52. CWL("Padavine (D ili N): ");
  53. pad1 = Convert.ToChar(Console.ReadLine());
  54.  
  55. if (pad1 != 'D' && pad1 != 'd' && pad1 != 'N' && pad1 != 'n')
  56. {
  57. CWL("Progresan unos!\n");
  58. }
  59. } while (pad1 != 'D' && pad != 'd' && pad != 'N' && pad != 'n');
  60.  
  61.  
  62. CWL("Unesite prognozu za Bihac: ");
  63. Temperatura();
  64. temp2 = Convert.ToInt32(Console.ReadLine());
  65.  
  66. do
  67. {
  68. CWL("Padavine (D ili N): ");
  69. pad2 = Convert.ToChar(Console.ReadLine());
  70.  
  71. if (pad2 != 'D' && pad2 != 'd' && pad2 != 'N' && pad2 != 'n')
  72. {
  73. CWL("Pogresan unos!\n");
  74. }
  75. } while (pad2 != 'D' && pad2 != 'd' && pad2 != 'N' && pad2 != 'n');
  76.  
  77. if (((temp > 20 && temp < 30) || (temp > -5 && temp < 0)) && (pad == 'N' && pad == 'n'))
  78. {
  79. CWL("Drugarice idu u Sarajevo!");
  80. }
  81. else if (((temp1 > 20 && temp1 < 30) || (temp1 > -5 && temp < 0)) && (pad1 == 'N' && pad1 == 'n'))
  82. {
  83. CWL("Drugarice idu u Mostar!");
  84. }
  85. else if (((temp1 > 20 && temp1 < 30) || (temp1 > -5 && temp < 0)) && (pad1 == 'N' && pad1 == 'n'))
  86. {
  87. CWL("Drugarice idu u Bihac!");
  88. }
  89. else if (((pad == 'N' || pad == 'n') && (temp > 5 && temp < 20)) || ((temp > -5 && temp <= 0) && (pad == 'D' || pad == 'd')))
  90. {
  91. CWL("Anja i Elma mogu u Sarajevo.");
  92.  
  93. }
  94. else if (((pad1 == 'N' || pad1 == 'n') && (temp1 > 5 && temp1 < 20)) || ((temp1 > -5 && temp1 <= 0) && (pad1 == 'D' || pad1 == 'd')))
  95. {
  96. CWL("Anja i Elma mogu u Mostar.");
  97.  
  98. }
  99. else if (((pad2 == 'N' || pad2 == 'n') && (temp2 > 5 && temp2 < 20)) || ((temp2 > -5 && temp2 <= 0) && (pad2 == 'D' || pad2 == 'd')))
  100. {
  101. CWL("Anja i Elma mogu u Bihac.");
  102.  
  103. }
  104. else if (((temp > -5 && temp < 5) || (temp > 20)) && (pad == 'N' || pad == 'n'))
  105. {
  106. CWL("Anja i Una mogu u Sarajevo.");
  107.  
  108. }
  109. else if (((temp1 > -5 && temp1 < 5) || (temp1 > 20)) && (pad1 == 'N' || pad1 == 'n'))
  110. {
  111. CWL("Anja i Una mogu u Mostar.");
  112.  
  113. }
  114. else if (((temp2 > -5 && temp2 < 5) || (temp2 > 20)) && (pad2 == 'N' || pad2 == 'n'))
  115. {
  116. CWL("Anja i Una mogu u Bihac.");
  117.  
  118. }
  119. else if (((temp > 20 && temp < 30) || (temp > -5 && temp < 5)) && (pad == 'N' || pad == 'n'))
  120. {
  121. CWL("Elma i Una mogu u Sarajevo.");
  122.  
  123. }
  124. else if (((temp1 > 20 && temp1 < 30) || (temp1 > -5 && temp1 < 5)) && (pad1 == 'N' || pad1 == 'n'))
  125. {
  126. CWL("Elma i Una mogu u Mostar.");
  127.  
  128. }
  129. else if (((temp2 > 20 && temp2 < 30) || (temp2 > -5 && temp2 < 5)) && (pad2 == 'N' || pad2 == 'n'))
  130. {
  131. CWL("Elma i Una mogu u Bihac.");
  132.  
  133. }
  134. else
  135. {
  136. CWL("Ne odgovara niti jedan grad.");
  137. }
  138.  
  139.  
  140.  
  141. }
  142. }
  143. */
  144. // Bankomat
  145. /*using System;
  146. class Program
  147. {
  148.  
  149. static void Main()
  150. {
  151. int n,a,b,c,f,w,q,s,l,H,m;
  152. do
  153. {
  154. Console.WriteLine("Unesite iznos: ");
  155. n = Convert.ToInt32(Console.ReadLine());
  156. } while (n < 0);
  157.  
  158. a = n % 50;
  159. b = n / 50;
  160. Console.WriteLine(b + " novcanice od 50KM");
  161.  
  162. c = a % 20;
  163. f = a / 20;
  164. Console.WriteLine(f + " novcanica od 20");
  165.  
  166. w = c % 10;
  167. q = c / 10;
  168. Console.WriteLine(q + " novcanica od 10");
  169.  
  170. s = w % 5;
  171. l = w / 5;
  172.  
  173. Console.WriteLine(l + " novcanica od 5");
  174.  
  175. H = s % 2;
  176. m = s / 2;
  177. Console.WriteLine(m + " novcanica od 2");
  178. }
  179. }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement