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