Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- struct Date{
- int month;
- int day;
- int year;
- };
- struct Note{
- int number_of_shop;
- struct Date date;
- float money;
- char surname[30];
- };
- int main(){
- int n;
- printf("Enter the count of notes: ");
- scanf("%d",&n);
- struct Note notes[n];
- for (int i=0;i<n;i++){
- printf("Enter the number of shop: ");
- scanf("%d",¬es[i].number_of_shop);
- printf("Enter the date\n");
- printf("Enter the month: ");
- scanf("%d", ¬es[i].date.month);
- printf("Enter the day: ");
- scanf("%d", ¬es[i].date.day);
- printf("Enter the year: ");
- scanf("%d", ¬es[i].date.year);
- printf("Enter the money: ");
- scanf("%f", ¬es[i].money);
- printf("Enter the surname: ");
- scanf("%s", notes[i].surname);
- printf("---------------------\n");
- }
- printf("Enter the day: ");
- int d;
- scanf("%d", &d);
- printf("Enter the money: ");
- float a;
- scanf("%f", &a);
- printf("----------------------\n");
- for (int i=0;i<n;i++){
- if ((notes[i].date.day==d)&&(notes[i].money<a)){
- printf("Number of shop: %d\n",notes[i].number_of_shop);
- }
- }
- printf("---------------------\n");
- printf("Enter the number of shop: ");
- int number;
- scanf("%d",&number);
- for (int i=0;i<n;i++){
- if (notes[i].number_of_shop == number){
- printf("Surname: %s",notes[i].surname);
- }
- }
- return 0;
- }
- /*
- lol kek cheburek
- cheburek kek lol
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement