TGM-GCC 4.9.2 64-bit Release
04:
#include
#include
int main(int argc, char *argv[])
{
system("chcp 1251 >nul");
setlocale(LC_ALL, "Russian");
int n, s; scanf("%d",&n);
int *m = new int[n];for(int i = 0; i < n; i++)
scanf("%d",&m[i]), s += m[i];
int max = m[0], min = m[0], iMax, iMin;
for(int i = 0; i < n; i++)
{
if(m[i] > max)
{
max = m[i];
iMax = i+1;
}
}
for(int i = n; i; i--)
{
if(m[i] < min)
{
min = m[i];
iMin = i+1;
}
}
delete [] m;
printf("%d\n%d %d\n%d %d", s, max, iMax, min, iMin);
return EXIT_SUCCESS;}
01:
#include
#include
int main(int argc, char *argv[])
{
system("chcp 1251 >nul");setlocale(LC_ALL, "Russian");
int *m = new int[2];int sum = 0;
scanf("%d%d",&m[0],&m[1]);
sum = m[0] + m[1];
delete [] m;
printf("%d",sum);
return EXIT_SUCCESS;
}