Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int n;
- typedef struct {
- int k; char arr[100];
- } type;
- type list[35];
- void Input(type list[]);
- void Output(type list[]);
- int main()
- {
- system("chcp 1251");
- printf("Скільки записів буде введено?\t");
- scanf_s("%d", &n);
- Input(list);
- Output(list);
- return 0;
- }
- void Input(type list[])
- {
- for (int i = 0; i < n; i++) {
- printf("\nКлюч: ");
- scanf_s("%d", &list[i].k);
- printf("\nПовідомлення: ");
- gets(list[i].arr);
- printf("\n");
- }
- }
- void Output(type list[])
- {
- for (int i = 0; i < n; i++) {
- printf("\n%d", list[i].k);
- puts(list[i].arr);
- printf("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement