Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdbool.h>
- int main(int argc, char *argv[])
- {
- bool kod = false;
- int i, code;
- char country;
- struct international
- {
- char *country;
- int code;
- };
- const struct international d_code[6] =
- { { "ARGENTINA", 54}, {"BRAZIL", 55}, {"CHINA", 86},
- {"GERMANY", 49}, {"POLAND", 48}, {"USA", 1} };
- printf("podaj kod: ");
- scanf("%d", &code);
- for( i = 0; i < 6; i++)
- if( code == d_code[i].code)
- {
- kod = true;
- printf("kod %d to do %s\n", code, d_code[i].country);
- }
- if(kod == false)
- printf("nie ma takiego numeru\n");
- system("PAUSE");
- return 0;
- }
Add Comment
Please, Sign In to add comment