Предмет: Информатика, автор: gopnik77

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

Приложения:

Ответы

Автор ответа: Аноним
0

1) #include <iostream>

#include <set>

#include <vector>

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";

   else

       cout << "NO";

}

2)

#include <iostream>

#include <set>

#include <vector>

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";

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

       cout << s[i];

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

       cout << s[i];

   cout << "\n";

   cout << s[2] << s[1] << s[0] << s[3];

}

3)

#include <iostream>

#include <set>

#include <vector>

using namespace std;

signed main() {

   ios_base::sync_with_stdio(0);

   cin.tie(0);

   cout.tie(0);

   string s;

   set<int> 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";

           return 0;

       }

   }

   cout << "NO";

}

Автор ответа: baybis
0

1) #include <iostream>

#include <set>

#include <vector>

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";

      cout << "NO"

2)

#include <iostream>

#include <set>

#include <vector>

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";

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

      cout << s[i];

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

      cout << s[i];

  cout << "\n";

 cout << s[2] << s[1] << s[0] << s[3];

3)

#include <iostream>

#include <set>

#include <vector>

using namespace std;

signed main() {

  ios_base::sync_with_stdio(0);

  cin.tie(0);

  cout.tie(0);

  string s;

  set<int> 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";

          return 0;

  cout << "NO";

Похожие вопросы
Предмет: Английский язык, автор: parus13

Переведите пожалуйста!!))                                            

                                        A SECOND LOOK AT SCHOOL LIFE

The first day at a new school is never easy. You are wearing new clothes but you are not sure if the astronaut helmet matches your kilt. Your teacher hovers above the floor, waiting for the final stragglers to arrive. A missing classmate eventually turns up twenty minutes late: she'd been trapped in a cloud of bubbles. Welcome to school life - in Second Life.

    Second Life - the online 3D computer game in which more than five million players worldwide create a virtual society - is being used to teach teenage pupils as part of "Schome":a project set up by Peter Twining, director of the centre for curriculum and teaching studies at the Open University. The main aims of Schome (School + Home) are to overcome the problems within the current education system and to develop a better way of learning for the 21st century.

     Initially, Dr Twining and his colleagues spent six months trying to get young people to suggest creative ideas for new education systems, but the results were disappoanting. Then they realised that the virtual world of Second Life affers a better way to test new designs and ideas whenever you want. In a traditional classroom, everyone knows what the rules are, what the teachers and pupils are supposed to do. But in a school in a virtual world you can challenge the established rules, and students can control what they do in a way that would be too expensive or difficult in reality.