#include <iostream> using namespace std; int A[20];
int main() { int n, c, p, max; int counter, ncounter; counter = 0; cin >> n; c = n; p = n; for (c; c>0;) { counter++; c = c / 10; A[counter] = p - c * 10; p = c; if (c > 0 && c < 10) { A[counter + 1] = c; } } max = 0; ncounter = 0; for (int s = 1; s <= counter; s++) { if (A[s] > max) { max = A[s]; ncounter = 0; } if (A[s] == max) { ncounter++; } } cout << ncounter; system("pause"); return 0; }
using namespace std;
int main()
{
int n,max, min, pos1, pos2, mem, sum;
cin >> n;
pos1 = 0;
pos2 = 0;
int *A = new int[n];
for (int i = 0; i < n; i++)
{
cin >> A[i];
}
min = A[0];
max = A[0];
for (int i = 0; i < n; i++)
{
if (A[i] > max)
{
max = A[i];
pos1 = i;
}
if (A[i] < min)
{
min = A[i];
pos2 = i;
}
}
if (pos2 > pos1)
{
mem = pos2;
pos2 = pos1;
pos1 = mem;
}
sum = 0;
for (pos2; pos2 <= pos1; pos2++)
{
sum = sum + A[pos2];
}
cout << sum;
system("pause");
return 0;
}
using namespace std;
int A[20];
int main()
{
int n, c, p, max;
int counter, ncounter;
counter = 0;
cin >> n;
c = n;
p = n;
for (c; c>0;)
{
counter++;
c = c / 10;
A[counter] = p - c * 10;
p = c;
if (c > 0 && c < 10)
{
A[counter + 1] = c;
}
}
max = 0;
ncounter = 0;
for (int s = 1; s <= counter; s++)
{
if (A[s] > max)
{
max = A[s];
ncounter = 0;
}
if (A[s] == max)
{
ncounter++;
}
}
cout << ncounter;
system("pause");
return 0;
}