Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int a;
- const char* m = "mezczyzna";
- const char* k = "kobieta";
- char plec[9];
- printf("Podaj wiek: ");
- scanf("%i", &a);
- printf("Podaj plec: ");
- scanf("%s", &plec);
- if (a >= 1 && a <= 3)
- {
- printf("1300");
- }
- else if (a >= 4 && a <= 6)
- {
- printf("1700");
- }
- else if (a >= 7 && a <= 9)
- {
- printf("2100");
- }
- else if (a >= 10 && a <= 12)
- {
- if (strcmp(plec, m) == 1)
- {
- printf("2600");
- }
- else
- {
- printf("2300");
- }
- }
- else
- {
- printf("Incorrect input");
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement