簡單陣列
#include<iostream>using namespace std ;
const int Totle = 4 ;
int Add;
int main()
{
cout << "Input 1 = " ;
cin >> Add ;
cout << "Input 2 = " ;
cin >> Add ;
cout << "Input 3 = " ;
cin >> Add ;
cout << "Input 4 = " ;
cin >> Add ;
cout << "Input 5 = " ;
cin >> Add ;
cout << Add << " " << Add << " " << Add << " " << Add << " " << Add ;
system("PAUSE") ;
return 0 ;
} #include<iostream>
using namespace std ;
const int Totle = 4 ;
int Add;
int main()
{
int max,min ;
for(int LoopA=0;LoopA<=Totle;LoopA++)
{
cout << "Input " << LoopA+1 << " = " ;
cin >> Add ;
}
for(int LoopB=0;LoopB<=Totle;LoopB++)
{
cout << Add << " " ;
min = Add;
if(min>max)
{
max=min;
}
}
cout << endl << "MAX = "<< max ;
system("PAUSE") ;
return 0 ;
}
頁:
[1]

