Links: https://ac.nowcoder.com/acm/problem/22015
Source: Cattle-off network
Time limit: C / C ++ 1 second, 2 seconds languages other
space restrictions: C / C ++ 32768K, other languages 65536k
64bit the IO the Format: LLD%
space restrictions: C / C ++ 32768K, other languages 65536k
64bit the IO the Format: LLD%
Title Description
Three number of input, output the maximum number, minimum number
Enter a description:
Input line, comprising three integers A, B, C ( . 1 ≤ A , B , C ≤ 1000000
Example 1
Export
#include<iostream> using namespace std; int main() { int a[3]; int max = 1; int min = a[0]; for(int i = 0;i < 3;i++) cin>>a[i]; for(int i = 0;i < 3;i++) { if(max < a[i]) max = a[i]; } cout<<"The maximum number is :"<<" "<<max<<endl; for(int i = 0;i < 3;i++) { if(min > a[i]) min = a[i]; cout<<min<<endl; } cout<<"The minimum number is :"<<" "<<min; return 0; }
copy
The maximum number is : 3 The minimum number is : 1