Pastebin

Paste #2687: No description

< previous paste - next paste>

Pasted by Anonymous Coward

Download View as text

#include <iostream>
using namespace std;

int main()
{
	int day[]={7,3,1,8,6,-3,-5,-2,6,4,-7,6};
	int max[3];
	for (int i=0;i<3;i++) max[i]=day[i];
	for (int i=3;i<12;i++)
	{
		int min=max[0], vt=0;
		for (int j=1;j<3;j++) if (max[j]<min) min=max[j],vt=j;
		if(day[i]>min) max[vt]=day[i];
	}
	cout<<"3 so max la: ";
	for (int j=0;j<3;j++) cout<<max[j]<<" ";
	return 0;
}

New Paste


Do not write anything in this field if you're a human.

Go to most recent paste.