Skip to content

Latest commit

 

History

History
45 lines (45 loc) · 3.25 KB

one_liners.md

File metadata and controls

45 lines (45 loc) · 3.25 KB
  1. Display the numbers from 0 to 10
  2. Display numbers from 100 to 200
    1. Display numbers from 100 to 200 in reverse order
  3. Display only even numbers from 0 to 50
  4. Find and display the sum of the numbers from 0 to 100
  5. Find and display the product of numbers from 1 to 10
  6. Read a number from the keyboard and print all its digits separately
    1. Print the fractional and integer parts of a number separately
    2. Find the maximum digit in the number
    3. Find the minimum digit in the number
    4. Write a program that outputs a number in letters. Example: 117 is one hundred and seventeen
  7. Find and output the sum of digits of a number
  8. Read a string from the keyboard, output it backwards
  9. Declare an array with 10 elements, fill it with elements from 0 to 9 and output it
  10. Read the size of the array from the keyboard. Enter an array of ints from the keyboard
  11. Find the sum of the array elements
  12. Find the product of the array elements
  13. Find the minimum element of the array
  14. Find the maximum element of the array
  15. Find the arithmetic mean of the array elements
  16. Swap the minimum and maximum elements of the array
  17. Read from the keyboard the size of two arrays, compare them element by element
  18. Double the value of all elements of the array
  19. Read from the keyboard an array of strings of user-defined size. Read another string, output all the strings containing the given string and the index from which such a substring begins
  20. Read from the keyboard an array of strings of user-defined size. Read one more string, remove the occurrence of the given string from all strings
  21. Read a string from the keyboard, split by semicolon. Add the elements to an array
  22. Read from the keyboard a string in which numbers are entered through the comma and decompose them into a numeric array
  23. Read from the keyboard an array of strings of user-defined length. Each of the lines contains semicolons. Parse through them and add them into an array of structures
  24. Describe a book with a structure. Display the book data on the screen
  25. Devise a way to store the book data in a single line. Read the book information from the keyboard and fill in the structure
  26. Devise a way to store an array of books in a string. Read book information from the keyboard and fill in an array of structures
  27. Describe a library with a structure. Devise a way to store library data in a file
  28. Create a file describing several libraries and read data from it into an array of structures
  29. Output the name of the library with the largest number of books
  30. Output the name of the library containing books by the largest number of authors
  31. Generate an 11-element array containing all digits from 0 to 10, but in any order
  32. Use a structure to describe a playing card
  33. Generate an ordered deck of cards
  34. Shuffle the deck of cards
  35. Find the positions of all aces in the deck
  36. Move all spade cards to the beginning of the deck
  37. Save the deck of cards to a file
  38. Read the deck of cards from the file
  39. Read 2 numbers from the keyboard, 1e (length) is the length of the array, 2e (max) is the value of the maximum element of the array. Generate such an array that it contains all elements from max - length to max, but in any order
  40. Sort an array of 39. Bubble