Monday, May 1, 2017

URI Solution 1366 Sticks Game - Solution in C++ | Ad Hoc

URI Solution 1366 Sticks Game - Solution in C++ | Ad Hoc


URI Online Judge Solution Sticks  | Ad Hoc
URI Main Problem Link -

Problem Name: URI Problem Sticks
Problem Number : URI Problem 1366 Solution
Online Judge : URI Online Judge Solution
Level: Ad Hoc
Solution Language : C plus plus

URI Solution 1366 Code in CPP:


#include <iostream>
using namespace std;

int main(int argc, char const *argv[])
{
    int n, x, c, v;

    while(cin >> n && n)
    {
        x = 0;
        for (int i = 0; i < n; ++i)
        {
            cin >> c >> v;
            x += v/2;
        }

        cout << x/2 << 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.