ПОМОГИТЕ СРОЧНО РЕШИТЬ ЭТИ ТРИ ЗАДАЧИ ЧЕРЕЗ DEVC++,ПОЖАЛУЙСТА

0 голосов
14 просмотров

ПОМОГИТЕ СРОЧНО РЕШИТЬ ЭТИ ТРИ ЗАДАЧИ ЧЕРЕЗ DEVC++,ПОЖАЛУЙСТА


image

Информатика (16 баллов) | 14 просмотров
Дано ответов: 2
0 голосов

1) #include

#include

#include

using namespace std;

signed main() {

   ios_base::sync_with_stdio(0);

   cin.tie(0);

   cout.tie(0);

   string a,b;

   cin >> a >> b;

   if(tolower(a[0]) == tolower(b[b.length()-1]))

       cout << "YES";</strong>

   else

       cout << "NO";</strong>

}

2)

#include

#include

#include

using namespace std;

signed main() {

   ios_base::sync_with_stdio(0);

   cin.tie(0);

   cout.tie(0);

   string a,b;

   string s = "tros";

   reverse(s.begin(),s.end());

   cout << s << "\n";</p>

   for(int i = s.length()-1; i >= 0; i -= 2)

       cout << s[i];</p>

   for(int i = s.length()-2; i >= 0; i -= 2)

       cout << s[i];</p>

   cout << "\n";</p>

   cout << s[2] << s[1] << s[0] << s[3];</p>

}

3)

#include

#include

#include

using namespace std;

signed main() {

   ios_base::sync_with_stdio(0);

   cin.tie(0);

   cout.tie(0);

   string s;

   set st;

   for(int i = 0; i < 10; i++)

       st.insert(i);

   getline(cin,s);

   for(auto i: s)

   {

       if(st.find(int(i)-48) != st.end())

       {

           cout << "YES";</strong>

           return 0;

       }

   }

   cout << "NO";</strong>

}

(688 баллов)
0 голосов

1) #include

#include

#include

using namespace std;

signed main() {

  ios_base::sync_with_stdio(0);

  cin.tie(0);

  cout.tie(0);

  string a,b;

  cin >> a >> b;

  if(tolower(a[0]) == tolower(b[b.length()-1]))

      cout << "YES";</strong>

      cout << "NO"</strong>

2)

#include

#include

#include

using namespace std;

signed main() {

  ios_base::sync_with_stdio(0);

  cin.tie(0);

  cout.tie(0);

  string a,b;

  string s = "tros";

  reverse(s.begin(),s.end());

  cout << s << "\n";</strong>

  for(int i = s.length()-1; i >= 0; i -= 2)

      cout << s[i];</strong>

  for(int i = s.length()-2; i >= 0; i -= 2)

      cout << s[i];</strong>

  cout << "\n";</strong>

 cout << s[2] << s[1] << s[0] << s[3];</strong>

3)

#include

#include

#include

using namespace std;

signed main() {

  ios_base::sync_with_stdio(0);

  cin.tie(0);

  cout.tie(0);

  string s;

  set st;

  for(int i = 0; i < 10; i++)

     st.insert(i);

 getline(cin,s);

 for(

   if(st.find(int(i)-48) != st.end())

          cout << "YES";</strong>

          return 0;

  cout << "NO";</strong>

(42 баллов)