Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdbool.h>
- int main()
- {
- int dzien, miesiac;
- printf("Podaj dzien urodzin: ");
- scanf("%d",&dzien);
- printf("Podaj miesiac urodzin (w postaci liczbowej!): ");
- scanf("%d",&miesiac);
- if (miesiac == 1)
- {
- if(dzien >= 20)
- {
- printf("Jestes wodnikiem");
- }
- else
- {
- printf("Jestes koziorozcem");
- }
- }
- if (miesiac == 2)
- {
- if(dzien >= 20)
- {
- printf("Jestes rybami");
- }
- else
- {
- printf("Jestes wodnikiem");
- }
- }
- if (miesiac == 3)
- {
- if(dzien >= 21)
- {
- printf("Jestes baranem");
- }
- else
- {
- printf("Jestes rybami");
- }
- }
- if (miesiac == 4)
- {
- if(dzien >= 21)
- {
- printf("Jestes bykiem");
- }
- else
- {
- printf("Jestes baranem");
- }
- }
- if (miesiac == 5)
- {
- if(dzien >= 22)
- {
- printf("Jestes bliznietami");
- }
- else
- {
- printf("Jestes bykiem");
- }
- }
- if (miesiac == 6)
- {
- if(dzien >= 22)
- {
- printf("Jestes rakiem");
- }
- else
- {
- printf("Jestes bliznietami");
- }
- }
- if (miesiac == 7)
- {
- if(dzien >= 24)
- {
- printf("Jestes lwem");
- }
- else
- {
- printf("Jestes rakiem");
- }
- }
- if (miesiac == 8)
- {
- if(dzien >= 24)
- {
- printf("Jestes panna");
- }
- else
- {
- printf("Jestes lwem");
- }
- }
- if (miesiac == 9)
- {
- if(dzien >= 24)
- {
- printf("Jestes waga");
- }
- else
- {
- printf("Jestes panna");
- }
- }if (miesiac == 10)
- {
- if(dzien >= 24)
- {
- printf("Jestes skorpionem");
- }
- else
- {
- printf("Jestes waga");
- }
- }
- if (miesiac == 11)
- {
- if(dzien >= 23)
- {
- printf("Jestes strzelcem");
- }
- else
- {
- printf("Jestes skorpionem");
- }
- }
- if (miesiac == 12)
- {
- if(dzien >= 22)
- {
- printf("Jestes koziorozcem");
- }
- else
- {
- printf("Jestes strzelcem");
- }
- }
- getchar();
- }
- /*
- int rok;
- printf("Podaj rok: ");
- scanf("%d",&rok);
- if( (rok%4 == 0 && rok%100 !=0) || rok%400 == 0 )
- {
- printf("Rok %d jest przestepny!", rok);
- }
- else
- {
- printf("Rok %d nie jest przestepny!", rok);
- }
- getchar();
- */
- /*
- char wybor;
- printf("Jezeli chcesz podac temperature w C wpisz C. Jezeli w F to wpisz F: ");
- scanf("%c",&wybor);
- float temp, temp2;
- if( wybor == 'C')
- {
- printf("Podaj temperature w stopniach Celsjusza: ");
- scanf("%f",&temp);
- temp2 = (temp*1.8)+32;
- printf("Temperatura %.2f *C to %.2f *F", temp,temp2);
- }
- else
- {
- printf("Podaj temperature w stopniach Fahrenaita: ");
- scanf("%f",&temp);
- temp2 = 5*(temp-32)/9;
- printf("Temperatura %.2f *F to %.2f *C", temp,temp2);
- }
- */
- /*
- int X1,X2;
- printf("Podaj wartosc X1: ");
- scanf("%d", &X1);
- printf("Podaj wartosc X2: ");
- scanf("%d", &X2);
- printf("X1 AND X2: ");
- if( X1 && X2)
- {
- printf("TRUE");
- }
- else
- {
- printf("FALSE");
- }
- printf("\n");
- printf("X1 OR X2: ");
- if( X1 || X2)
- {
- printf("TRUE");
- }
- else
- {
- printf("FALSE");
- }
- printf("\n");
- printf("X1 XOR X2: ");
- if( (X1 && !X2) || (X2 && !X1))
- {
- printf("TRUE");
- }
- else
- {
- printf("FALSE");
- }
- printf("\n");
- printf("NOT X1: ");
- if( X1)
- {
- printf("FALSE");
- }
- else
- {
- printf("TRUE");
- }
- printf("\n");
- printf("NOT X2: ");
- if( X2)
- {
- printf("FALSE");
- }
- else
- {
- printf("TRUE");
- }
- */
- /*
- char wybor[3];
- printf("Podaj pole do sprawdzenia: ");
- scanf("%2c",&wybor);
- int pole;
- pole = (int)wybor[1];
- pole -=48;
- pole += (int)wybor[0]-64;
- if (pole %2 == 0)
- {
- printf("Pole %s jest czerwone.",wybor);
- }
- else{
- printf("Pole %s jest biale.",wybor);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement