TAILIEUCHUNG - A Complete Guide to Programming in C++ part 20

A Complete Guide to Programming in C++ part 20. This book provides both novice and experienced programmers with a comprehensive resource manual for the C++ programming language. Readers gain experience in all aspects of programming, from elementary language concepts to professional software development, with in depth coverage of all the language elements en route. These elements are carefully ordered to help the reader create useful programs every step of the way. | SOLUTIONS 169 Exercise 2 ------------------------------------------------------- Reads and compares lines of text. ------------------------------------------------------- include iostream include string using namespace std string header Testing palindromes prompt Enter a word line 50 - int main string word Empty string char key y cout n t header endl while key y key Y cout n line n prompt cin word Compares the first and last character the second and the second to last etc. int i 0 j - 1 for i j i --j if word i word j break if i j All characters equal cout nThe word word is a P A L I N D R O M E endl else cout nThe word word is not a palindrome endl cout nRepeat y n do key while key y key Y key n key N return 0 170 CHAPTER 9 THE STANDARD CLASS STRING Exercise 3 The program outputs the date and time a greeting is printed according the time of day. For example Date and time Thu Nov 28 09 01 37 2001 Have a wonderful morning chapter Functions This chapter describes how to write functions of your own. Besides the basic rules the following topics are discussed passing arguments definition of inline functions overloading functions and default arguments the principle of recursion. .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.