Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int task5() {
- string s;
- cin >> s;
- bool k = true;
- for (int i = 0; i < s.length(); i++) {
- if (s[i] != s[s.length() - i - 1]) {
- k = false;
- break;
- }
- }
- (k) ? cout << "yes" : cout << "no";
- return 0;
- }
- int task4() {
- string s, s1;
- int count = 1;
- getline(cin, s);
- for (char c : s) {
- if (c == ' ') {
- count++;
- }
- }
- cout << count;
- return 0;
- }
- int task3() {
- char c;
- cin >> c;
- if (c >= 'a' && c <= 'z') {
- c = c - 'a' + 'A';
- }
- else if (c >= 'A' && c <= 'Z') {
- c = c - 'A' + 'a';
- }
- cout << c;
- return 0;
- }
- int task2() {
- char c;
- cin >> c;
- (c >= 'a' && c <= 'z') ? cout << (c = c - 'a' + 'A') : cout << c;
- return 0;
- }
- int task1() {
- char c;
- cin >> c;
- (c >= '0' && c <= '9') ? cout << "yes" : cout << "no";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement