Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.84 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdbool.h>
  3. int main()
  4. {
  5. int dzien, miesiac;
  6. printf("Podaj dzien urodzin: ");
  7. scanf("%d",&dzien);
  8. printf("Podaj miesiac urodzin (w postaci liczbowej!): ");
  9. scanf("%d",&miesiac);
  10. if (miesiac == 1)
  11. {
  12.     if(dzien >= 20)
  13.     {
  14.         printf("Jestes wodnikiem");
  15.     }
  16.     else
  17.     {
  18.         printf("Jestes koziorozcem");
  19.     }
  20. }
  21. if (miesiac == 2)
  22. {
  23.     if(dzien >= 20)
  24.     {
  25.         printf("Jestes rybami");
  26.     }
  27.     else
  28.     {
  29.         printf("Jestes wodnikiem");
  30.     }
  31. }
  32. if (miesiac == 3)
  33. {
  34.     if(dzien >= 21)
  35.     {
  36.         printf("Jestes baranem");
  37.     }
  38.     else
  39.     {
  40.         printf("Jestes rybami");
  41.     }
  42. }
  43. if (miesiac == 4)
  44. {
  45.     if(dzien >= 21)
  46.     {
  47.         printf("Jestes bykiem");
  48.     }
  49.     else
  50.     {
  51.         printf("Jestes baranem");
  52.     }
  53. }
  54. if (miesiac == 5)
  55. {
  56.     if(dzien >= 22)
  57.     {
  58.         printf("Jestes bliznietami");
  59.     }
  60.     else
  61.     {
  62.         printf("Jestes bykiem");
  63.     }
  64. }
  65. if (miesiac == 6)
  66. {
  67.     if(dzien >= 22)
  68.     {
  69.         printf("Jestes rakiem");
  70.     }
  71.     else
  72.     {
  73.         printf("Jestes bliznietami");
  74.     }
  75. }
  76. if (miesiac == 7)
  77. {
  78.     if(dzien >= 24)
  79.     {
  80.         printf("Jestes lwem");
  81.     }
  82.     else
  83.     {
  84.         printf("Jestes rakiem");
  85.     }
  86. }
  87. if (miesiac == 8)
  88. {
  89.     if(dzien >= 24)
  90.     {
  91.         printf("Jestes panna");
  92.     }
  93.     else
  94.     {
  95.         printf("Jestes lwem");
  96.     }
  97. }
  98. if (miesiac == 9)
  99. {
  100.     if(dzien >= 24)
  101.     {
  102.         printf("Jestes waga");
  103.     }
  104.     else
  105.     {
  106.         printf("Jestes panna");
  107.     }
  108. }if (miesiac == 10)
  109. {
  110.     if(dzien >= 24)
  111.     {
  112.         printf("Jestes skorpionem");
  113.     }
  114.     else
  115.     {
  116.         printf("Jestes waga");
  117.     }
  118. }
  119. if (miesiac == 11)
  120. {
  121.     if(dzien >= 23)
  122.     {
  123.         printf("Jestes strzelcem");
  124.     }
  125.     else
  126.     {
  127.         printf("Jestes skorpionem");
  128.     }
  129. }
  130. if (miesiac == 12)
  131. {
  132.     if(dzien >= 22)
  133.     {
  134.         printf("Jestes koziorozcem");
  135.     }
  136.     else
  137.     {
  138.         printf("Jestes strzelcem");
  139.     }
  140. }
  141.     getchar();
  142. }
  143.  
  144. /*
  145.     int rok;
  146.     printf("Podaj rok: ");
  147.     scanf("%d",&rok);
  148.     if( (rok%4 == 0 && rok%100 !=0) || rok%400 == 0 )
  149.     {
  150.         printf("Rok %d jest przestepny!", rok);
  151.     }
  152.     else
  153.     {
  154.          printf("Rok %d nie jest przestepny!", rok);
  155.     }
  156.     getchar();
  157.  
  158. */
  159.  
  160. /*
  161.     char wybor;
  162.     printf("Jezeli chcesz podac temperature w C wpisz C. Jezeli w F to wpisz F: ");
  163.     scanf("%c",&wybor);
  164.     float temp, temp2;
  165.     if( wybor == 'C')
  166.     {
  167.         printf("Podaj temperature w stopniach Celsjusza: ");
  168.         scanf("%f",&temp);
  169.         temp2 = (temp*1.8)+32;
  170.         printf("Temperatura %.2f *C to %.2f *F", temp,temp2);
  171.     }
  172.     else
  173.     {
  174.         printf("Podaj temperature w stopniach Fahrenaita: ");
  175.         scanf("%f",&temp);
  176.         temp2 = 5*(temp-32)/9;
  177.         printf("Temperatura %.2f *F to %.2f *C", temp,temp2);
  178.     }
  179. */
  180. /*
  181. int X1,X2;
  182. printf("Podaj wartosc X1: ");
  183. scanf("%d", &X1);
  184. printf("Podaj wartosc X2: ");
  185. scanf("%d", &X2);
  186.  
  187. printf("X1 AND X2: ");
  188. if( X1 && X2)
  189. {
  190.     printf("TRUE");
  191. }
  192. else
  193. {
  194.     printf("FALSE");
  195. }
  196. printf("\n");
  197. printf("X1 OR X2: ");
  198. if( X1 || X2)
  199. {
  200.     printf("TRUE");
  201. }
  202. else
  203. {
  204.     printf("FALSE");
  205. }
  206. printf("\n");
  207. printf("X1 XOR X2: ");
  208. if( (X1 && !X2) || (X2 && !X1))
  209. {
  210.     printf("TRUE");
  211. }
  212. else
  213. {
  214.     printf("FALSE");
  215. }
  216. printf("\n");
  217. printf("NOT X1: ");
  218. if( X1)
  219. {
  220.     printf("FALSE");
  221. }
  222. else
  223. {
  224.     printf("TRUE");
  225. }
  226. printf("\n");
  227. printf("NOT X2: ");
  228. if( X2)
  229. {
  230.     printf("FALSE");
  231. }
  232. else
  233. {
  234.     printf("TRUE");
  235. }
  236.  
  237. */
  238. /*
  239. char wybor[3];
  240. printf("Podaj pole do sprawdzenia: ");
  241. scanf("%2c",&wybor);
  242. int pole;
  243. pole = (int)wybor[1];
  244. pole -=48;
  245. pole += (int)wybor[0]-64;
  246. if (pole %2 == 0)
  247. {
  248.     printf("Pole %s jest czerwone.",wybor);
  249. }
  250. else{
  251.     printf("Pole %s jest biale.",wybor);
  252. }
  253. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement