Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <algorithm>
- using namespace std;
- void fifth ()
- {
- string s;
- getline(cin,s);
- string str = s;
- for (int i = 0; i < s.size();i++){
- str[i] = s[s.size() - i - 1];
- }
- if ( s == str){
- cout << "YES";}
- else{
- cout << "NO";
- }
- }
- void fourth ()
- {
- int y,t =1;
- string p;
- getline(cin,p);
- y = p.length();
- t = t + count(p.begin(), p.end(), ' ');
- cout << "Result: " << t << endl;
- }
- void third()
- {
- char z;
- cin >> z;
- if ((z >= 97) && (z <= 122)){
- z = z - 32;
- cout << z;
- }else {
- // if ((z >= 65) && (z <= 90)){
- z = z + 32;
- cout << z;
- }
- }
- void second()
- {
- char m;
- cin >> m;
- m -= 32;
- cout << m;
- }
- void first()
- {
- string s;
- cin >> s;
- if ((s == "0") && (s == "9") && (s == "1") && (s == "2") && (s == "3") && (s == "4") && (s == "5") && (s == "6") && (s == "7") && (s == "8")){
- cout << "Yes";
- }
- else
- {
- cout << "No";
- }
- }
- int main()
- {
- int u;
- cout << "vvedite nomer zadachi" << endl;
- cin >> u;
- if (u == 1){
- first();
- }
- if (u == 2){
- second();
- }
- if (u == 3){
- third();
- }
- if (u == 4){
- fourth();
- }
- if (u == 5){
- fifth();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement