#include <bits/stdc++.h> using namespace std; int t,n,a; int f(int n[],int a){ if(a==1){ t=n[1]; }else{ if(f(n,a-1)>n[a]){ t=f(n,a-1); }else{ t=n[a]; } } return t; } int main(){ int n[6],x; for(int i=0;i<5;i++){ cin>>n[i]; } x=f(n,5); cout<<x<<endl; return 0; }
标签:std,递归,int,最大值,else,main From: https://www.cnblogs.com/fushuxuan/p/17725647.html