Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C++? Input a batch of plastic data in turn, end the input when -99999 is input, and then output the smallest number and the second decimal.
C++? Input a batch of plastic data in turn, end the input when -99999 is input, and then output the smallest number and the second decimal.
//#include "stdafx.h"//vc++6.0 add this line.

# include & ltiostream & gt

Use namespace std

Invalid primary (invalid) {

int min 1=0x7FFFFFFF,min2=min 1,n;

Cout & lt& lt "Enter some data ... \ n ";;

CIN & gt; & gtn;

And (n! =-99999){

if(min 1 & gt; n){

min 2 = min 1;

min 1 = n;

}

else if(min 2 & gt; n & amp& ampn! =min 1)

min 2 = n;

CIN & gt; & gtn;

}

Cout & lt& lt "the smallest is"<< min1<; & lt".\ n "<& lt The biggest thing is"<< min2 & lt< ".\ n";

}