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
Articulation and Bridges
მატრიცა
Tree
Testul 11(2021)
std::string(pid_t)
RegexSearch
wealth of banks
My Tuple class
2021(M2)Simulare:S3:1
Dar