Sunday, April 30, 2017

URI Solution 1129 Optical Reader - Solution in C++ | Ad Hoc

URI Solution 1129 Optical Reader - Solution in C++ | Ad Hoc


URI Online Judge Solution Optical Reader | Ad Hoc


Problem Name: URI Problem Optical Reader
Problem Number : URI - 1129
Online Judge : URI Online Judge Solution
Level: Ad Hoc
Solution Language : C plus plus

URI Solution 1129 Code in CPP:


#include <iostream>
using namespace std;

int main()
{
    int n, q, tmp, counter;
    
    while (cin >> n && n != 0)
    {
        for (int i = 0; i < n; ++i)
        {
            counter = 0;
            for (int j = 1; j <= 5; ++j)
            {
                cin >> q;
                if (q <= 127) {
                    tmp = j;
                    counter++;
                }
            }
            
            if (counter > 1 || counter == 0) {
                cout << "*" << endl;
            }else{
                if (tmp == 1) {
                    cout << "A" << endl;
                }else if(tmp == 2){
                    cout << "B" << endl;
                }else if(tmp == 3){
                    cout << "C" << endl;
                }else if(tmp == 4){
                    cout << "D" << endl;
                }else{
                    cout << "E" << endl;
                }
            }
        }
    }
    
    return 0;
}

No comments:
Write comments

To know more about the problem, give us your valuable commment. We'll try to help you. Thanks

All rights reserved ©2016 -URI ONLINE JUDGE SOLUTION | Developed by Maniruzzaman Akash

© 2016 URI ONLINE JUDGE SOLUTION. Developed by Maniruzzaman Akash | Distributed By Gooyaabi Templates
Powered by Blogger.