We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#include<cmath>#include<cstdio>#include<vector>#include<iostream>#include<algorithm>usingnamespacestd;intmax_value(inta,intb,intc,intd){intinputs[]={a,b,c,d};intmax_v=inputs[0];intsize=sizeof(inputs)/sizeof(inputs[0]);for(inti=0;i<size;i++){if(inputs[i]>max_v){max_v=inputs[i];};};returnmax_v;}intmain(){/* Enter your code here. Read input from STDIN. Print output to STDOUT */inta;intb;intc;intd;scanf("%d\n",&a);scanf("%d\n",&b);scanf("%d\n",&c);scanf("%d\n",&d);printf("%d\n",max_value(a,b,c,d));return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Functions
You are viewing a single comment's thread. Return to all comments →