1)вычислите сумму двоичных чисел 11101 и 1011. результат представьте в двоичной системе счисления. 2)запишите значение переменной d, полученное в результате работы следующей программы .текст программы на трех языках программирования. ((
1) #include <iostream> #include <conio.h> #include <string> using namespace std; int main() { string str; getline(cin, str); for (int i = 1; i < str.length(); i++) { if (i % 3 == 0) {cout << str[i] << endl;} } _getch(); return 0; } 2) #include <iostream> #include <conio.h> #include <string> using namespace std; int main() { string str; getline(cin, str); for (int i = 1; i < str.length(); i++) { if (i % 2 == 0) { if (str[i] != 'a') { str[i] = 'a'; } if (str[i] != 'b') { str[i] = 'b'; } if (str[i] != 'c') { str[i] = 'c'; } } } cout << str << endl; _getch(); return 0;}
tatry2005
23.11.2020
#include <iostream> #include <string> int main() { using namespace std;
//1й пункт string s1 = "Computer programming (often shortened to programming) is a process"; for (int i = 2; i < s1.size(); i = i + 3) cout << s1[i]; cout << endl;
//2й пункт string s2 = "Programming involves activities such as analysis, developing understanding"; for (int i = 1; i < s2.size(); i = i + 2) if (s2[i] != 'a' && s2[i] != 'b') s2[i] = 'a'; else s2[i] = 'c'; cout << s2 << endl;
б) 8+2=10+1=11 [11]
29-11=18
ответ:18