Programming Taskbook


E-mail:

Password:

User registration   Restore password

Russian

SFedU SMBU

Electronic problem book on programming

©  M. E. Abramyan (Southern Federal University, Shenzhen MSU-BIT University), 1998–2026

 

Tasks | Task groups | TablBase

PrevNext


Tabular Data Processing

Tabular Data Processing (Countries)

TablBase1°. Given the Countries table and a string S — the name of one of the countries. Each country has the fields Name (string field), Capital (string field), WorldPart (string field), Population (integer field). Output the description of the country S.

TablBase2°. Given the Countries table and a string Cap — the name of the capital of one of the countries. Each country has the fields Name (string field), Capital (string field), WorldPart (string field), Population (integer field). Find the country with the capital Cap and output its description.

TablBase3°. Given the Countries table and an integer N. Find all countries whose population does not exceed N. Output the number of found countries and their descriptions.

TablBase4°. Given the Countries table, a string WPart, and an integer N. Find all countries with a population greater than N, located in the world part WPart. Output the number of found countries and their descriptions.

TablBase5°. Given the Countries table, a string WPart, and integers N1 and N2 (N1 < N2). Find all countries located in the world part WPart and having a population between N1 and N2 inclusive. Output the number of found countries and their descriptions, sorting the descriptions by increasing population.

TablBase6°. Given the Countries table and an integer N. Find all countries whose capital names have a length of N characters. Output the number of found countries and their descriptions, sorting the descriptions by world part in alphabetical order, and within one world part — by capital names (also in alphabetical order).

TablBase7°. Given the Countries table and integers N1 and N2 (N1 < N2). Find all countries with a population between N1 and N2 inclusive and group the found countries by world part. Iterating over the world parts in alphabetical order, output for each of them the name and the number K of found countries.

TablBase8°. Given the Countries table and integers N1 and N2 (N1 < N2). Group the countries by world part and for each world part find the total population for countries with a population between N1 and N2 inclusive. For each world part, output its name and the found total population S, sorting the world parts by decreasing total population, and world parts with the same total population — by world part names in alphabetical order (for some world parts the total population may be 0).

TablBase9°. Given the Countries table and integers N1 and N2 (N1 < N2). Group the countries by world part and for each world part find all countries with a population between N1 and N2 inclusive. Iterating over the world parts in alphabetical order, output for each of them the name and the average population value A of the found countries. If the required countries for any world part are absent, then output 0.0 for A.

TablBase10°. Given the Countries table and an integer N. Group the countries by world part and for each world part find N countries with the minimum population (or all countries if there are fewer than N countries in this world part). Output the descriptions of the found countries, sorting them by world part name in alphabetical order, and within one world part — by increasing population.

Tabular Data Processing (Students)

TablBase11°. Given the Students table and an integer H. Each student has the fields Name (string field), Gender (string field with values "Male" and "Female"), Height (integer field), Class (integer field), DevClub (member of the DevClub programming club, boolean field). Find all students with a height greater than H cm. Output the number of found students and their descriptions.

TablBase12°. Given the Students table and an integer H. Each student has the fields Name (string field), Gender (string field with values "Male" and "Female"), Height (integer field), Class (integer field), DevClub (member of the DevClub programming club, boolean field). Find all girls with a height less than H cm. Output the number of found students and their descriptions.

TablBase13°. Given the Students table and integers C1 and C2 (C1 ≤ C2). Find all students who study in classes from C1 to C2 inclusive. Output the number of found students and their descriptions.

TablBase14°. Given the Students table and integers C1 and C2 (C1 ≤ C2). Find all students who study in classes from C1 to C2 inclusive and are also members of the programming club. Output the number of found students and their descriptions.

TablBase15°. Given the Students table and integers C and H. Output the number of students in class C whose height is greater than H cm.

TablBase16°. Given the Students table and integers C1, H1, C2, H2. Answer two questions: 1) is it true that some students of class C1 have a height greater than H1 cm, 2) is it true that all students of class C2 have a height less than H2 cm? As an answer to each question, output the boolean value true or false.

TablBase17°. Given the Students table and integers C1, H1, C2, H2. Output two real numbers: A1 — the average height of students in class C1 whose height is greater than H1 cm, A2 — the average height of students in class C2 whose height is less than H2 cm. It is known that the numbers A1 and A2 exist.

TablBase18°. Given the Students table and integers C1, H1, C2, H2. Output two real numbers: A1 — the average height of students in class C1 whose height is greater than H1 cm, A2 — the average height of students in class C2 whose height is less than H2 cm. If the required students are absent, then output 0.0 as the result.

TablBase19°. Given the Students table and integers C1, C2. Output two integers: A1 — the maximum height among students of class C1, A2 — the minimum height among students of class C2.

TablBase20°. Given the Students table and integers C1, H1, C2, H2. Output two integers: A1 — the minimum height among students of class C1 whose height is greater than H1 cm, A2 — the maximum height among students of class C2 whose height is less than H2 cm. If the required students are absent, then output 0 as the result.

TablBase21°. Given the Students table and an integer C. Find all students who study in class C, and sort them in order of increasing height, and students with the same height — by last name in alphabetical order. Output the number of found students and their descriptions.

TablBase22°. Given the Students table and an integer C. Find all boys who study in class C, and sort them in order of decreasing height, and students with the same height — by last name in alphabetical order. Output the number of found students and their descriptions.

TablBase23°. Given the Students table and integers C1 and C2 (C1 ≤ C2). Find all students who study in classes from C1 to C2 inclusive, and sort them by increasing class number, within one class — by decreasing height, and students of the same class with the same height — by last name in alphabetical order. Output the number of found students and their descriptions.

TablBase24°. Given the Students table and integers C1 and C2 (C1 ≤ C2). Find all students who study in classes from C1 to C2 inclusive and are also members of the programming club, and sort them by decreasing class number, and within one class — by last name in alphabetical order. Output the number of found students and their descriptions.

TablBase25°. Given the Students table and integers C and K. Find the K tallest students who study in class C, and sort them by decreasing height, and students with the same height — by last name in alphabetical order. Output the number of found students and their descriptions. If there are fewer than K required students, then output all of them.

TablBase26°. Given the Students table and integers C and K. Find the K shortest students who study in class C and are also members of the programming club, and sort them by increasing height, and students with the same height — by last name in alphabetical order. Output the number of found students and their descriptions. If there are fewer than K required students, then output all of them.

TablBase27°. Given the Students table and an integer C. Group all students from class C by the length of their names and output for each found group the associated name length and the number of students whose names have the specified length. Order the data by decreasing name lengths.

TablBase28°. Given the Students table and integers C1 and C2 (C1 ≤ C2). Group all students who study in classes from C1 to C2 inclusive by the initial letter of their names and output for each found group the associated letter and the number of students whose names start with the specified letter. Order the data in alphabetical order of the letters.

TablBase29°. Given the Students table and integers H1 and H2 (H1 ≤ H2). Group students by gender and for each gender select those students whose height is between H1 cm and H2 cm inclusive. Output first the number KM of selected male students, and then — the number KF of female students.

TablBase30°. Given the Students table and integers H1 and H2 (H1 ≤ H2). Group students by class and for each class select those students whose height is between H1 cm and H2 cm inclusive. Iterating over the classes in increasing order, output for each class its value and the average height H of the selected students from this class. If the required students are absent in any class, then output 0.0 for H.


PrevNext

 

  Ðåéòèíã@Mail.ru

Designed by
M. E. Abramyan and V. N. Braguilevsky

Last revised:
01.01.2026