Here, you may find the solutions to famous problems of various coding platforms like SPOJ || HACKEREARTH etc.
Please leave a comment in case you need solution or editorial to any problem.
Get Solutions || Editorials of Famous DP problems. Happy Coding :)
Search This Blog
Monday, 22 August 2016
SPOJ - A Game with Numbers O(1) solution
SPOJ - A Game with Numbers O(1) solution
Solution:-
#include<bits/stdc++.h>
using namespace std;
int main()
{
int N;
cin>>N;
if(N%10==0)
cout<<"2";
else
cout<<"1"<<endl<<N%10;
return 0;
No comments:
Post a Comment