На с++ будет так
#include <iostream>
int main()
{
int Count;
std::cout << "Enter count of numbers\n";
std::cin >> Count;
int Numbers[1000];
std::cout << "Enter "<< Count <<" numbers\n";
for (int i = 0; i < Count; i++)
std::cin >> Numbers[i];
}
int MaxNumber = -1;
int MaxNumberIndex = -1;
int TempNumberEnd;
TempNumberEnd = Numbers[i] % 10;
if (TempNumberEnd == 3 && Numbers[i] > MaxNumber)
MaxNumberIndex = i;
MaxNumber = Numbers[i];
std::cout << "Max value number index " << (MaxNumberIndex+1)<< "\n";
std::cin.get();
##
var n := ReadInteger;
var s := ReadSeqInteger(n);
s.Where(t -> t mod 10 = 3).Max.Print
На с++ будет так
#include <iostream>
int main()
{
int Count;
std::cout << "Enter count of numbers\n";
std::cin >> Count;
int Numbers[1000];
std::cout << "Enter "<< Count <<" numbers\n";
for (int i = 0; i < Count; i++)
{
std::cin >> Numbers[i];
}
int MaxNumber = -1;
int MaxNumberIndex = -1;
int TempNumberEnd;
for (int i = 0; i < Count; i++)
{
TempNumberEnd = Numbers[i] % 10;
if (TempNumberEnd == 3 && Numbers[i] > MaxNumber)
{
MaxNumberIndex = i;
MaxNumber = Numbers[i];
}
}
std::cout << "Max value number index " << (MaxNumberIndex+1)<< "\n";
std::cin.get();
}
##
var n := ReadInteger;
var s := ReadSeqInteger(n);
s.Where(t -> t mod 10 = 3).Max.Print