STRUCT - Struct
Dữ liệu vào: Standard input
Dữ liệu ra: Standard output
Giới hạn thời gian: 2.0 giây
Giới hạn bộ nhớ: 128 megabyte
Đăng bởi: admin

Struct is a way to combine multiple fields to represent a composite data structure, which further lays the foundation for Object Oriented Programming. For example, we can store details related to a student in a struct consisting of his age (int), first_name (string), last_name (string) and standard (int).

struct can be represented as:

struct NewType {
    type1 value1;
    type2 value2;
    .
    .
    .
    typeN valueN;
};

You have to create a struct, named Student, representing the student's details, as mentioned above, and store the data of a student.

Input : Input will consist of four lines.
- The first line will contain an integer, representing age.
- The second line will contain a string, consisting of lower-case Latin characters ('a'-'z'), representing the first_name of a student.
- The third line will contain another string, consisting of lower-case Latin characters ('a'-'z'), representing the last_name of a student.
- The fourth line will contain an integer, representing the standard of student.

Note: The number of characters in first_name and last_name will not exceed 50.

Output Output will be of a single line, consisting of agefirst_namelast_name and standard, each separated by one white space.

 

Ví dụ

  • input
    15
    john
    carmack
    10
    output
    15 john carmack 10

 

 
Back to Top