#include <iostream>
#include <string>
#include <conio.h>
#define ESC 27
using namespace std;
int main() {
char ch;
int sum = 0;
do {
ch = _getch();
if (ch == ESC) {
cout << "Output of the program:\n" << sum;
putchar('\n');
} else {
cout << ch;
sum += (int)ch;
}
} while (ch != ESC);
system("pause");
return 0;
Объяснение:
#include <vector>
void solve(){
int m,n;
cin >> m >> n;
vector<vector<int>> a(m,vector<int>(n));
vector<bool> b(m, true);
for(int i = 0; i < m; i++)
for(int j = 0; j < n; j++)
cin >> a[i][j];
for(int j = 1; j < n; j++)
if(a[i][j] <= a[i][j-1])
b[i] = false;
for(auto i : b) cout << i << " ";
signed main(){
solve();
#include <iostream>
#include <string>
#include <conio.h>
#define ESC 27
using namespace std;
int main() {
char ch;
int sum = 0;
do {
ch = _getch();
if (ch == ESC) {
cout << "Output of the program:\n" << sum;
putchar('\n');
} else {
cout << ch;
sum += (int)ch;
putchar('\n');
}
} while (ch != ESC);
system("pause");
return 0;
}
Объяснение:
#include <iostream>
#include <vector>
using namespace std;
void solve(){
int m,n;
cin >> m >> n;
vector<vector<int>> a(m,vector<int>(n));
vector<bool> b(m, true);
for(int i = 0; i < m; i++)
for(int j = 0; j < n; j++)
cin >> a[i][j];
for(int i = 0; i < m; i++)
for(int j = 1; j < n; j++)
if(a[i][j] <= a[i][j-1])
b[i] = false;
for(auto i : b) cout << i << " ";
}
signed main(){
solve();
}