4/06/2017

Geeksforgeeks Solution For " Reverse Coding "

GeeksforGeeks Solution For Hard Domain .Below You Can Find The Solution Of  School Basic ,Easy ,Medium . Or Hackerrank Solution You Can Also Direct Submit Your Solution to Geeksforgeeks Same Problem .You Need to login then you can submit you answers 

Problem :- Reverse Coding

Submit Your Solution :- Click Here 

Solution :- 

#include <iostream>
using namespace std;

int main() {
int t;
cin>>t;
while(t--){
   int n,m;
   cin>>n>>m;
   int c=(n*(n+1))/2;
   if(c==m)
       cout<<1<<endl;
        else
            cout<<0<<endl;
}
return 0;
}

Output:-



Geeksforgeeks Solution For " Reverse Coding "

1 comment:

  1. I feel really finicky reading these articles I mean there are writers that can write reasonable stuff.
    c++ programming tutorial

    ReplyDelete