Quick actions

cmd+k|ctrl+k

Navigation

Languages

StructArrayCPP_2

Snippet info

Language

Cpp

Visibility

public

Author

speranskiyva

Created

2019-04-25T14:11:59Z

Updated

2019-09-30T07:05:06Z

#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>

using namespace std;

struct NOTE 
{
   char name[100];
   char family[100];
   char tele[15];
   char date[100];
};

int main(void) 
{
    NOTE note[10];
    
    for (int i = 0; i < 10; i++)
    {
       printf("note %d:\n", i);
       printf("name: ");
       scanf("%s", note[i].name);
       printf("family: ");
       scanf("%s", note[i].family);
       printf("telephone: ");
       scanf("%s", note[i].tele);
       printf("date (day, month, year): ");
       scanf("%s", note[i].date);
    }

   char z[15];
   printf("date (day, month, year): ");
   scanf("%s", z);
   for (int i = 0; i < 10; i++)
      if (strcmp(note[i].date, z) == 0)
      {
        cout << "" << endl;
        printf("name: %s\n family %s\n telephone %s\n data %s\n ", note[i].name, note[i].family, note[i].tele, note[i].date);
      }

    system("pause");
    return 0;
    
}
INFO