Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
ADP_campus
//Q came in ADP campus recruitment and unfortunately their compiler didn't supported stoi. My logic was still the same. #include <bits/stdc++.h> using namespace std; int main() { string str,st; getline(cin, str); int p,l,a[10]; st="";str=str+","; p=0; l=3; for(int i=0;str[i]!='\0';i++) { if(str[i]==',') { a[p]= stoi(st); p++; st=""; } else { st= st + str[i]; } } sort(a,a+l); int max = (a[1]*a[1])+(a[2]*a[2]); int min = (a[0]*a[0])+(a[1]*a[1]); cout<<(max-min); }
run
|
edit
|
history
|
help
0
EN WU WU
CIDP2k19
cppPyFoodVatTip
Find the row with max ones
PhB
Exempel 4
nobita's candies problem
List add v2
Podejrzana karteczka :0
Jilebi Nimki