static void Main(string[] args)
{
string F;
string[] nota = new string[7];
nota[0] = "До";
nota[1] = "Ре";
nota[2] = "Ми";
nota[3] = "Фа";
nota[4] = "Соль";
nota[5] = "Ля";
nota[6] = "Си";
Console.WriteLine("Введите ноту");
F = Console.ReadLine();
int Index = -1;
for(int i=0;i<7;i++)
{
if(nota[i]==F)
{
Index = i+2;
if (Index > 6) Index = Index - 7;
}
}
if(Index == -1) Console.WriteLine("Нота не найдена");
else Console.WriteLine(nota[Index]);
Console.ReadLine();
}
#include <iostream>
using namespace std;
int main()
{
const int row_size = 20;
const int col_size = 20;
int arr[row_size][col_size];
int row; cout << " Enter row = "; cin >> row;
int col; cout << " Enter col = "; cin >> col;
for (int i = 0; i < row; i++) {
for (int j = 0; j < col; j++) {
cout << " Enter arr[" << i << "][" << j << "] = ";
cin >> arr[i][j];
}
}
int sum = 0;
for (int i = 0; i < row; i++){
for (int j = 0; j < col; j++) {
sum += arr[i][j];
}
cout << " " << sum;
sum = 0;
}
cout << endl;
return 0;
}
Объяснение:
Ручки