๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.63K subscribers
5.61K photos
3 videos
95 files
10.6K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
#include <bits/stdc++.h>

using namespace std;


/*
* Complete the 'decodeIP' function below.
*
* The function accepts STRING hexaIP as parameter.
*/
int superExams(string n)
{
return stoi(n,0,16);
}
void decodeIP(string hexaIP) {
string s="",s1="",s2="",s3="",s4="";
s+=hexaIP[0];
s+=hexaIP[1];
s1+=hexaIP[2];
s1+=hexaIP[3];
s2+=hexaIP[4];
s2+=hexaIP[5];
s3+=hexaIP[6];
s3+=hexaIP[7];
s4+=hexaIP[8];
s4+=hexaIP[9];

int n=superExams(s);
if(hexaIP.size()<=7)
cout<<"Invalid input";
else
{ if(n>1 && n<=127)
{
cout<<superExams(s)<<"."<<superExams(s1)<<"."<<superExams(s2)<<"."<<superExams(s3)<<endl; cout<<"A";
}
else if(n>=128 && n<=191)
{
cout<<superExams(s)<<"."<<superExams(s1)<<"."<<superExams(s2)<<"."<<superExams(s3)<<endl;
cout<<"B";
}
else if(n>=192 && n<=223)
{
cout<<superExams(s)<<"."<<superExams(s1)<<"."<<superExams(s2)<<"."<<superExams(s3)<<endl; cout<<"C";
}
else if(n>=224 && n<=239)
{
cout<<superExams(s)<<"."<<superExams(s1)<<"."<<superExams(s2)<<"."<<superExams(s3)<<endl; cout<<"D";
}
else if(n>=240 && n<=255)
{
cout<<superExams(s)<<"."<<superExams(s1)<<"."<<superExams(s2)<<"."<<superExams(s3)<<endl; cout<<"D";
}

}

}

int main()
{
string hexaIP;
getline(cin, hexaIP);

decodeIP(hexaIP);

return 0;
} IP Address C++(IBM) โœ…
๐Ÿ‘1
If you try to help someone unconditionally, without expecting anything in return. God has his way of paying back and
๐†๐จ๐ ๐ง๐ž๐ฏ๐ž๐ซ ๐Ÿ๐จ๐ซ๐ ๐ž๐ญ๐ฌ.โค๏ธ๐Ÿ’ฏ
โค7๐Ÿ”ฅ2๐Ÿ˜2