Thursday, 7 September 2017

OjLight Problem 1294 - Positive Negetive Number (C++)

Problem:

Solution:

This is the one of the simplest problem I ever had, just implement using the given formulas! However, it does take me some time to write.

Code:

#include <bits/stdc++.h>
using namespace std;
int main(){
long long t;
long long n,m,result;
cin>>t;
for(int i=1;i<=t;i++){
    cin>>n>>m;
    result = m*(n/2);
    cout<<"Case "<<i<<": "<<result<<endl;

}
return 0;

}








No comments:

Post a Comment

Spoj Problem ACMCEG2C - Pick the candies (C++)

  The problem link may be found here.       Explanation: Use Deque to keep track of elements of the variety of candies. If i is gre...