公式
A - Three Threes 解説 by en_translator
For beginners
- 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".
- 「C++入門 AtCoder Programming Guide for beginners (APG4b)」 is a C++ tutorial for competitive programmers. Sadly, this is only in Japanese.
Receive \(N\) as input, and print \(N\) \(N\) times using a for statement.
Since there are only nine patterns of input, one can use a if statement to implement a conditional branch, but it is wiser to use a for statement.
Sample code (C++):
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
for(int i = 0; i < n; i++) cout << n;
cout << endl;
}
Sample code (Python):
n = int(input())
for i in range(n):
print(n, end = '')
投稿日時:
最終更新: