URI Solution 1199 Simple Base Conversion in C++
URI Online Judge Solution 1199 Simple Base Conversion| Mathematics
URI Main Problem Link - https://www.urionlinejudge.com.br/judge/en/problems/view/1199
Problem Name: URI Problem 1199 Simple Base Conversion
Problem Number : URI Problem 1199 Simple Base Conversion Solution
Online Judge : URI Online Judge Solution
Level: Mathematics
Solution Language : C plus plus
URI Solution 1199 Simple Base Conversion Code in CPP:
#include <iostream> #include <cstring> #include <cstdlib> #include <sstream> using namespace std; int main() { int n; string s; while(getline(cin, s)) { n = atoi(s.c_str()); if(n < 0){ return 0; } if(s[1] == 'x'){ istringstream(s) >> std::hex >> n; cout << std::dec << n << endl; }else{ cout << "0x" << std::hex << uppercase << n << endl; } } }
Tags: Uri solve , Uri solution, URI oj Solve, URI Online Judge Solution list, URI 1199 Solution, URI 1199 solution in C, URI 1199 solution in C++
No comments:
Write commentsTo know more about the problem, give us your valuable commment. We'll try to help you. Thanks