Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Struktury.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include "string.h"
- struct Dane
- {
- char imie[20];
- char nazwisko[25];
- char data[11];
- };
- int _tmain(int argc, _TCHAR* argv[])
- {
- int liczbagosci;
- int i = 0;
- printf("Podaj liczbe gosci\n");
- scanf_s("%d", &liczbagosci);
- struct Dane osoby[10];
- for(i = 0; i < liczbagosci; i++)
- {
- printf("Podaj imie\n");
- scanf_s("%s", osoby[i].imie, 20);
- printf("Podaj nazwisko\n");
- scanf_s("%s", osoby[i].nazwisko, 25);
- printf("Podaj date urodzenia\n");
- scanf_s("%s", osoby[i].data, 12);
- }
- for (int k = 0; k < i; k++)
- {
- printf("%s %s ur.%s\n", osoby[i].imie, osoby[i].nazwisko, osoby[i].data);
- }
- getchar();
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement