Official

A - Last Two Digits Editorial by en_translator


If you are new to learning programming and do not know where to start, please try Problem A “Welcome to AtCoder” from practice contest. There you can find a sample code for each language.
Also, if you are not familiar with problems in programming contests, we recommend you to try some problems in “AtCoder Beginners Selection” (https://atcoder.jp/contests/abs).
「競プロ典型 90 問」(Typical 90 Problems of Competitive Programming) (https://atcoder.jp/contests/typical90) is a collection of typical 90 competitive programming problems; unfortunately, currently the problem statements are all Japanese.
「C++入門 AtCoder Programming Guide for beginners (APG4b)」(https://atcoder.jp/contests/APG4b) is a C++ tutorial for competitive programmers. Sadly, this is only in Japanese too.


The ones digit of the integer \(N\) is the remainder when \(N\) is divided by \(10\), and the tens digit of the integer \(N\) is the quotient when dividing by \(10\) the remainder when \(N\) is divided by \(100\). Therefore, you may output them consecutively.

Note that you may not output the remainder of \(N\) divided by \(100\), since the cases like \(304\) yield results like \(4\), where \(04\) is the correct answer.

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  cout<<(n%100)/10<<n%10<<endl;
}

posted:
last update: